* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: #1a1a2e;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

.game-container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
}

.welcome-screen {
    text-align: center;
    animation: fadeIn 0.5s ease-in-out;
}

.welcome-screen h1 {
    font-size: 2.5rem;
    margin-bottom: 30px;
    color: #f8bb22;
    text-shadow: 0 0 10px rgba(248, 187, 34, 0.5);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.input-group input {
    padding: 12px 15px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    background-color: rgba(255, 255, 255, 0.9);
    transition: all 0.3s;
}

.input-group input:focus {
    outline: none;
    box-shadow: 0 0 10px rgba(248, 187, 34, 0.7);
}

.input-group button {
    padding: 12px 15px;
    background-color: #f8bb22;
    color: #1a1a2e;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.input-group button:hover {
    background-color: #ffcc33;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(248, 187, 34, 0.4);
}

.game-screen {
    display: none;
    flex-direction: column;
    gap: 20px;
    animation: fadeIn 0.5s ease-in-out;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.player-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.player-info span:first-child {
    font-weight: 600;
    color: #f8bb22;
}

#restartGame {
    padding: 8px 15px;
    background-color: #e94560;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
}

#restartGame:hover {
    background-color: #ff6b81;
    transform: translateY(-2px);
}

.game-board {
    width: 100%;
    aspect-ratio: 1/1;
    background-color: #16213e;
    border-radius: 5px;
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    grid-template-rows: repeat(10, 1fr);
    gap: 2px;
    padding: 2px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

.cell {
    background-color: #1a1a2e;
    border-radius: 2px;
    transition: all 0.2s;
}

.cell.filled {
    background-color: #f8bb22;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
}

.next-block {
    width: 100%;
    height: 100px;
    background-color: #16213e;
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.next-block::before {
    content: "Next Block:";
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 0.8rem;
    color: #f8bb22;
}

.next-block-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 2px;
    width: 80px;
    height: 80px;
}

.next-cell {
    background-color: transparent;
    border-radius: 2px;
}

.next-cell.filled {
    background-color: #f8bb22;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
}

/* Mobile controls */
.mobile-controls {
    display: none;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 10px;
    margin-top: 15px;
}

.control-btn {
    padding: 15px 0;
    background-color: #333;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.control-btn:active {
    background-color: #f8bb22;
    transform: scale(0.95);
}

#moveLeft {
    grid-column: 1;
    grid-row: 2;
}

#moveRight {
    grid-column: 3;
    grid-row: 2;
}

#moveDown {
    grid-column: 2;
    grid-row: 2;
}

#rotateBtn {
    grid-column: 1;
    grid-row: 1;
}

#hardDrop {
    grid-column: 3;
    grid-row: 1;
}

/* Tampilkan tombol kontrol hanya di perangkat mobile */
@media (max-width: 768px) {
    .mobile-controls {
        display: grid;
    }
}

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

@keyframes clearRow {
    0% { background-color: #f8bb22; }
    50% { background-color: #ffffff; }
    100% { background-color: #1a1a2e; }
}