/* レトロ調の基本設定（フォントをピクセルアート風に近づける） */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

body {
    background-color: #1a1a1a;
    color: #e0e0e0;
    font-family: 'Press Start 2P', monospace;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    /* スマホでのテキスト選択やハイライトを無効化 */
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

#game-container {
    text-align: center;
    max-width: 500px;
    width: 100%;
    padding: 10px;
}

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

h1 {
    color: #ffcc00;
    /* レトロアーケード風の黄色 */
    margin: 0;
    font-size: 24px;
    text-shadow: 2px 2px 0px #880000;
}

.sound-btn {
    font-size: 10px;
    padding: 8px 12px;
    background-color: #222;
    border-color: #555;
    box-shadow: 0 2px 0 #111;
}

.sound-btn.muted {
    background-color: #555;
    color: #aaa;
}

.game-area {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

/* メインキャンバスの見た目 */
#game-board {
    background-color: #000;
    border: 4px solid #444;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
    /* 実際の表示サイズをCSSで制御し、アスペクト比を維持 */
    width: 100%;
    max-width: 300px;
    height: auto;
    aspect-ratio: 1 / 2;
}

/* サイドパネル（PC画面や横画面時用） */
#side-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.info-box {
    background-color: #333;
    border: 2px solid #555;
    padding: 10px;
    text-align: center;
}

.info-box h2 {
    font-size: 10px;
    margin: 0 0 10px 0;
    color: #00ccff;
}

.info-box p {
    font-size: 14px;
    margin: 0;
}

#next-piece {
    background-color: #000;
    border: 2px solid #555;
    width: 80px;
    height: 80px;
}

/* スマホ用コントロールパネル */
#mobile-controls {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 10px;
    background-color: #222;
    border-radius: 10px;
    border: 2px solid #444;
}

.center-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.control-btn {
    background-color: #444;
    color: #fff;
    border: 2px solid #666;
    border-radius: 8px;
    font-family: 'Press Start 2P', monospace;
    font-size: 16px;
    padding: 15px;
    cursor: pointer;
    box-shadow: 0 4px 0 #222;
    /* 物理ボタン風の厚み */
}

/* 押したときの凹み表現 */
.control-btn:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 #222;
}

#btn-drop {
    padding: 8px 15px;
    font-size: 12px;
}

/* Drop(一気に落とす)ボタンは少し小さく */
#btn-rotate {
    background-color: #cc0000;
    border-color: #ff3333;
    box-shadow: 0 4px 0 #660000;
}

/* 回転ボタンを目立たせる */
#btn-rotate:active {
    box-shadow: 0 0 0 #660000;
}

/* スマホ以下のサイズの場合のレスポンシブ調整 */
@media (max-width: 480px) {
    .game-area {
        flex-direction: column;
        align-items: center;
    }

    #side-panel {
        flex-direction: row;
        width: 100%;
        max-width: 300px;
        justify-content: space-between;
    }

    .info-box {
        flex: 1;
        margin: 0 5px;
        padding: 5px;
    }

    .info-box h2 {
        font-size: 8px;
    }

    .info-box p {
        font-size: 12px;
    }

    #next-piece {
        width: 60px;
        height: 60px;
    }
}