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

body {
    font-family: sans-serif;
    background-color: #1a1a1a; 
    color: #ffffff;
    text-align: center;
    margin: 0;
    padding: 30px 10px 10px 10px;
    user-select: none;
    -webkit-user-select: none;
    overflow-x: hidden;
}

/* ===================================================
   📱 スマホ基準の設定（横幅360px固定・中央寄せ）
   =================================================== */
.game-container {
    width: 360px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* ===================================================
   💻 PC基準の設定（画面幅768px以上のとき、綺麗に2倍の720pxに）
   =================================================== */
@media screen and (min-width: 768px) {
    .game-container {
        width: 720px;
    }
    
    .cell {
        font-size: 45px !important; 
    }
}

/* ===================================================
   🎨 デザイン・装飾（オリジナルスタイル）
   =================================================== */
.title-board {
    width: 100%;
    background-color: #242b31;
    padding: 10px;
    border-radius: 16px;
    border: 5px solid #7f8c8d;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

.game-title {
    font-size: 22px;
    color: #00d2d3;
    letter-spacing: 1px;
    font-weight: bold;
}

.result-area {
    font-size: 14px;
}

#remain-count {
    color: #f1c40f; 
    font-size: 16px;
    font-weight: bold;
}

#game-status {
    color: #1dd1a1;
    font-size: 14px;
    font-weight: bold;
    display: block;
    min-height: 20px;
}

.panel-wrapper {
    width: 100%;
    position: relative;
}

.panel-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    background-color: #2c3e50;
    padding: 4px;
    border-radius: 16px;
    border: 5px solid #7f8c8d;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

.cell {
    width: 100%;
    aspect-ratio: 1;
    background-color: #ffffff;
    border: 1px solid #bdc3c7;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 6.5vw; 
    line-height: 1;
    cursor: pointer;
    overflow: hidden;
}

.cell.empty {
    visibility: hidden;
}

.sys-btn {
    display: inline-block;
    width: 180px;
    padding: 12px 0;
    font-size: 15px;
    font-weight: bold;
    letter-spacing: 1px;
    background-color: #00d2d3;
    color: #1a1a1a;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    margin-top: 5px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.sys-btn:active {
    background-color: #00b3b4;
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}