/* 全体のスタイル */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    color: #2c3e50;
    margin-bottom: 10px;
}

h2 {
    color: #3498db;
    margin-bottom: 15px;
}

h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

section {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 25px;
    margin-bottom: 30px;
}

.hidden {
    display: none;
}

/* 数字入力エリア */
.input-area {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
}

.number-display {
    display: flex;
    gap: 10px;
    margin-right: 15px;
}

.digit {
    width: 50px;
    height: 50px;
    border: 2px solid #3498db;
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
    background-color: #ecf0f1;
}

/* 数字パッド */
.number-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 300px;
    margin: 0 auto 20px;
}

.number-btn {
    width: 60px;
    height: 60px;
    font-size: 24px;
    font-weight: bold;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.number-btn:hover {
    background-color: #2980b9;
}

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

/* ボタン */
.control-btn {
    padding: 8px 15px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s;
}

.control-btn:hover {
    background-color: #c0392b;
}

.action-btn {
    display: block;
    width: 200px;
    padding: 12px;
    margin: 20px auto;
    background-color: #2ecc71;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

.action-btn:hover {
    background-color: #27ae60;
}

.action-btn:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

/* ゲームプレイ画面 */
.game-status {
    text-align: center;
    margin-bottom: 20px;
}

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

@media (min-width: 768px) {
    .game-board {
        flex-direction: row;
    }
    
    .player-area {
        flex: 1;
    }
    
    .history-area {
        flex: 1;
    }
}

.history-area {
    display: flex;
    gap: 20px;
}

.history-column {
    flex: 1;
}

.history-list {
    list-style-type: none;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 5px;
    min-height: 200px;
    max-height: 300px;
    overflow-y: auto;
}

.history-list li {
    padding: 8px;
    margin-bottom: 5px;
    background-color: #e9ecef;
    border-radius: 3px;
}

/* 結果画面 */
.secret-numbers {
    display: flex;
    justify-content: space-around;
    margin: 20px 0;
    flex-wrap: wrap;
    gap: 20px;
}

.secret-box {
    text-align: center;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 5px;
    min-width: 200px;
}

.secret-display {
    font-size: 32px;
    font-weight: bold;
    color: #e74c3c;
    margin-top: 10px;
}

.result-history {
    display: flex;
    gap: 20px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.result-history .history-column {
    flex: 1;
    min-width: 250px;
}

.winning-guess {
    background-color: #d4edda !important;
    color: #155724;
    font-weight: bold;
    border-left: 4px solid #28a745;
}

/* シェアボタン */
.share-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.share-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.2s;
}

.share-btn:hover {
    opacity: 0.9;
}

.x-btn {
    background-color: #000000;
}

.fb-btn {
    background-color: #3b5998;
}

/* モーダル */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    text-align: center;
}

/* デバッグパネル */
.debug-panel {
    margin-top: 20px;
    text-align: center;
    padding: 10px;
    border-top: 1px dashed #ccc;
}

.debug-btn {
    padding: 8px 15px;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.debug-btn:hover {
    background-color: #5a6268;
}

.debug-options {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

/* レスポンシブ対応 */
@media (max-width: 767px) {
    .history-area {
        flex-direction: column;
    }
    
    .number-btn {
        width: 50px;
        height: 50px;
    }
    
    .digit {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .secret-numbers {
        flex-direction: column;
        align-items: center;
    }
}
