/* 数字当てゲーム シンプルCSS */

/* 基本リセット */
* {
    box-sizing: border-box;
}

/* メインコンテナ */
.main-container {
    margin: 0 auto;
}

/* カード */
.card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* ゲームアイコン */
.game-icon {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 10px;
}

/* ボタン共通 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

/* スタートボタン */
.start-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    padding: 15px 30px;
    font-size: 1.2rem;
    border-radius: 25px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.start-btn:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
}

/* ゲーム情報グリッド */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    background: #f8fafc;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.info-item {
    text-align: center;
}

.info-label {
    display: block;
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 5px;
}

.info-value {
    display: block;
    font-size: 1.2rem;
    font-weight: bold;
    color: #1f2937;
}

/* 数字入力エリア - 最も重要 */
.guess-input {
    max-width: 400px;
    margin: 0 auto 30px auto;
    text-align: center;
}

.guess-input label {
    display: block;
    margin-bottom: 10px;
    font-size: 1.1rem;
    font-weight: bold;
    color: #374151;
}

.input-group {
    display: flex;
    gap: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

#guessInput {
    flex: 1;
    padding: 15px;
    border: 2px solid #d1d5db;
    background: white;
    font-size: 1.2rem;
    text-align: center;
    border-radius: 8px 0 0 8px;
    outline: none;
}

#guessInput:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.submit-btn {
    padding: 15px 20px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.submit-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

/* ヒントボタン */
.hint-btn {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

.hint-btn:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}

.hint-content {
    background: #fef3c7;
    border: 2px solid #f59e0b;
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
    color: #92400e;
    font-weight: 600;
    text-align: center;
}

/* 推測履歴 */
.guess-history {
    background: #f8fafc;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.history-list {
    max-height: 200px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: white;
    border-radius: 6px;
    margin-bottom: 8px;
}

.history-guess {
    font-weight: bold;
}

.history-result {
    padding: 4px 8px;
    border-radius: 4px;
    color: white;
    font-size: 0.9rem;
}

.history-result.too-high { background: #ef4444; }
.history-result.too-low { background: #3b82f6; }
.history-result.correct { background: #10b981; }

/* 結果カード */
.result-card {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 15px;
    border: 3px solid #0284c7;
}

.result-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.result-title {
    font-size: 1.8rem;
    font-weight: bold;
    color: #0f4c75;
    margin-bottom: 10px;
}

.result-message {
    color: #0369a1;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 1.4rem;
    font-weight: bold;
    color: #1f2937;
}

/* アクションボタン */
.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn {
    padding: 12px 20px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
}

.action-btn.primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.action-btn.secondary {
    background: white;
    color: #374151;
    border: 2px solid #e5e7eb;
}

.action-btn:hover {
    transform: translateY(-2px);
}

/* スコアセクション */
.score-section {
    margin-top: 30px;
}

.section-title {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 20px;
    color: #374151;
    border-bottom: 2px solid #f3f4f6;
    padding-bottom: 10px;
}

.score-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.score-tab {
    padding: 8px 16px;
    border: 2px solid #e5e7eb;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
}

.score-tab:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

.score-tab.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.score-item {
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.score-info {
    flex: 1;
}

.score-date {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 4px;
}

.score-details {
    font-size: 0.9rem;
    color: #374151;
}

.score-value {
    font-size: 1.3rem;
    font-weight: bold;
    color: #1f2937;
}

.no-scores {
    text-align: center;
    color: #6b7280;
    padding: 30px;
    background: #f9fafb;
    border-radius: 8px;
    border: 2px dashed #d1d5db;
}

/* 設定セクション */
.difficulty-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 8px;
}

.difficulty-option:hover {
    border-color: #3b82f6;
    background: #f8faff;
}

.option-label {
    flex: 1;
}

.difficulty-name {
    font-weight: 600;
    color: #374151;
    display: block;
    margin-bottom: 2px;
}

.difficulty-desc {
    font-size: 0.85rem;
    color: #6b7280;
}

.option-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    margin-bottom: 8px;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .main-container {
        padding: 10px;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    #guessInput {
        border-radius: 8px;
        margin-bottom: 10px;
    }
    
    .submit-btn {
        border-radius: 8px;
    }
    
    .result-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .action-btn {
        width: 200px;
    }
}

/* アニメーション */
.bounce-in {
    animation: bounceIn 0.6s ease-out;
}

@keyframes bounceIn {
    0% { opacity: 0; transform: scale(0.3); }
    50% { opacity: 1; transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

.shake {
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}