* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #1e1e2e 0%, #2a2a3e 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #fff;
}

#gameContainer {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

#gameInfo {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 270px;
}

.info-panel {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
}

.info-panel h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: center;
    color: #fff;
    letter-spacing: 2px;
}

.stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.stat:last-child {
    margin-bottom: 0;
}

.stat .label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 1px;
    font-weight: 600;
}

.stat .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

.next-panel {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
}

.next-panel h3 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 1px;
}

#nextCanvas {
    display: block;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

#holdCanvas {
    display: block;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin-left: 12px;
}

.controls {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    font-size: 0.85rem;
    line-height: 1.8;
    margin-left: -200px;
}

.controls p {
    margin-bottom: 0.25rem;
    color: rgba(255, 255, 255, 0.7);
}

.controls strong {
    color: #fff;
}

.controls .key-bind {
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: background 0.2s;
}

.controls .key-bind:hover {
    background: rgba(255, 255, 255, 0.05);
}

.controls .key-bind span {
    font-weight: 600;
    color: #667eea;
}

.controls input[type="number"] {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #fff;
    padding: 2px 6px;
    font-size: 0.75rem;
    width: 60px;
}

.controls input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
}

#gameBoard {
    position: relative;
}

#gameCanvas {
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    background: rgba(0, 0, 0, 0.3);
}

#gameOver {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(30, 30, 46, 0.98);
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 3rem;
    text-align: center;
    min-width: 250px;
}

#gameOver h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #ff6b6b;
    letter-spacing: 2px;
}

#gameOver p {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
}

#restartBtn {
    margin-top: 1.5rem;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

#restartBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

#restartBtn:active {
    transform: translateY(0);
}

.unselectable-item {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

@media (max-width: 768px) {
    #gameContainer {
        flex-direction: column;
        align-items: center;
    }
    
    #gameInfo {
        flex-direction: row;
        width: auto;
        flex-wrap: wrap;
    }
}