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

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

.container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    color: #333;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.home-link {
    color: #667eea;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.home-link:hover {
    color: #764ba2;
}

.game-area {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.input-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-weight: bold;
    color: #333;
}

.input-group input {
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
}

.generate-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.generate-btn:active {
    transform: translateY(0);
}

.result-section {
    text-align: center;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 10px;
}

.result-display {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.result-label {
    font-size: 1.1rem;
    color: #666;
    font-weight: bold;
}

.random-number {
    font-size: 3rem;
    font-weight: bold;
    color: #667eea;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.random-number.animate {
    transform: scale(1.1);
    color: #764ba2;
}

.range-info {
    color: #888;
    font-size: 0.9rem;
    font-style: italic;
}

.history-section {
    border-top: 2px solid #e0e0e0;
    padding-top: 1.5rem;
}

.history-section h3 {
    color: #333;
    margin-bottom: 1rem;
    text-align: center;
}

.history-list {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    max-height: 150px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background: white;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.history-number {
    font-weight: bold;
    color: #667eea;
    font-size: 1.2rem;
}

.history-range {
    color: #666;
    font-size: 0.8rem;
}

.history-time {
    color: #999;
    font-size: 0.7rem;
}

.no-history {
    text-align: center;
    color: #999;
    font-style: italic;
}

.clear-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 1rem;
    width: 100%;
    transition: background-color 0.3s ease;
}

.clear-btn:hover {
    background: #c82333;
}

.error {
    border-color: #dc3545 !important;
    animation: shake 0.5s ease-in-out;
}

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

@media (max-width: 600px) {
    .container {
        padding: 1rem;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .random-number {
        font-size: 2rem;
    }
}
