/* 基本設定 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #333;
}

/* ゲームコンテナ */
.game-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 600px;
    overflow: hidden;
    animation: slideIn 0.6s ease-out;
}

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

/* ヘッダー */
.game-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 30px 20px;
    text-align: center;
}

.game-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.game-header h1 i {
    margin-right: 10px;
    color: #ffd700;
}

.game-description {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* メインゲームエリア */
.game-main {
    padding: 30px 20px;
}

/* ゲーム情報 */
.game-info {
    display: flex;
    justify-content: space-around;
    margin-bottom: 30px;
    gap: 10px;
}

.info-card {
    background: #f8f9ff;
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    flex: 1;
    border: 2px solid #e8ecff;
    transition: all 0.3s ease;
}

.info-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

.info-card i {
    color: #667eea;
    margin-right: 8px;
    font-size: 1.1rem;
}

.info-card strong {
    color: #667eea;
    font-weight: 600;
}

/* ゲームエリア */
.game-area {
    text-align: center;
    margin-bottom: 30px;
}

.number-display {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 700;
    margin: 0 auto 30px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.number-display:hover {
    transform: scale(1.05);
}

.number-display.correct {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    animation: pulse 0.6s ease-in-out;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* 入力セクション */
.input-section {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

#guessInput {
    padding: 15px 20px;
    border: 2px solid #e8ecff;
    border-radius: 12px;
    font-size: 1.2rem;
    width: 200px;
    text-align: center;
    font-weight: 600;
    transition: all 0.3s ease;
}

#guessInput:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ボタンスタイル */
.btn {
    padding: 15px 25px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-secondary {
    background: #f8f9ff;
    color: #667eea;
    border: 2px solid #e8ecff;
}

.btn-hint {
    background: linear-gradient(135deg, #ff9a9e, #fecfef);
    color: white;
}

/* ヒントセクション */
.hint-section {
    margin-bottom: 20px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hint {
    background: #fff3cd;
    border: 2px solid #ffeaa7;
    color: #856404;
    padding: 15px 20px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    max-width: 400px;
}

.hint.success {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.hint.danger {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.hint.info {
    background: #cce7ff;
    border-color: #b3d9ff;
    color: #004085;
}

/* 範囲表示 */
.range-display {
    margin-bottom: 20px;
}

.range-info {
    background: #f8f9ff;
    padding: 12px 20px;
    border-radius: 12px;
    color: #667eea;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

/* ゲームコントロール */
.game-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

/* 予想履歴 */
.guess-history {
    border-top: 2px solid #f1f3f8;
    padding-top: 30px;
}

.guess-history h3 {
    color: #667eea;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.history-item {
    background: #f8f9ff;
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid #667eea;
}

.history-item.too-high {
    border-left-color: #ff6b6b;
}

.history-item.too-low {
    border-left-color: #4ecdc4;
}

.history-item.correct {
    border-left-color: #4CAF50;
    background: #f0f8f0;
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.4s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-30px) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-header {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    padding: 25px 20px;
    text-align: center;
}

.modal-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
}

.modal-body {
    padding: 25px 20px;
    text-align: center;
}

.modal-body p {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: #333;
}

.result-stats {
    display: flex;
    justify-content: space-around;
    gap: 20px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.stat i {
    color: #4CAF50;
    font-size: 1.5rem;
}

.modal-footer {
    padding: 0 20px 25px;
    text-align: center;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .game-container {
        margin: 10px;
    }
    
    .game-header h1 {
        font-size: 2rem;
    }
    
    .game-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .input-section {
        flex-direction: column;
        gap: 15px;
    }
    
    #guessInput {
        width: 100%;
        max-width: 300px;
    }
    
    .game-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .result-stats {
        flex-direction: column;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .game-main {
        padding: 20px 15px;
    }
    
    .game-header {
        padding: 20px 15px;
    }
    
    .number-display {
        width: 100px;
        height: 100px;
        font-size: 2.5rem;
    }
}