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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.game-container {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-width: 450px;
    width: 100%;
}

.game-header {
    text-align: center;
    margin-bottom: 20px;
}

.game-header h1 {
    font-size: 2.5rem;
    color: #3498db;
    text-shadow: 0 0 20px rgba(52, 152, 219, 0.5);
}

.game-header .subtitle {
    color: #ecf0f1;
    font-size: 1rem;
    margin-top: 5px;
    letter-spacing: 3px;
}

.game-info {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 15px;
}

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

.info-label {
    display: block;
    color: #95a5a6;
    font-size: 0.8rem;
    font-weight: bold;
}

.info-value {
    display: block;
    color: #ecf0f1;
    font-size: 1.5rem;
    font-weight: bold;
}

.hint {
    text-align: center;
    font-size: 1.3rem;
    padding: 20px;
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    color: #ecf0f1;
}

.hint.up {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.2);
}

.hint.down {
    color: #3498db;
    background: rgba(52, 152, 219, 0.2);
}

.hint.correct {
    color: #2ecc71;
    background: rgba(46, 204, 113, 0.2);
}

.guess-history {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    min-height: 40px;
}

.guess-item {
    padding: 5px 12px;
    border-radius: 15px;
    font-weight: bold;
    font-size: 0.9rem;
}

.guess-item.up {
    background: rgba(231, 76, 60, 0.3);
    color: #e74c3c;
}

.guess-item.down {
    background: rgba(52, 152, 219, 0.3);
    color: #3498db;
}

.input-section {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#guessInput {
    flex: 1;
    padding: 15px;
    font-size: 1.5rem;
    text-align: center;
    border: none;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.9);
    color: #1a1a2e;
    outline: none;
}

#guessInput::placeholder {
    color: #95a5a6;
}

#guessBtn {
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: bold;
    border: none;
    border-radius: 15px;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

#guessBtn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.4);
}

#guessBtn:disabled {
    background: #7f8c8d;
    cursor: not-allowed;
}

.number-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.num-btn {
    padding: 15px;
    font-size: 1.5rem;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #ecf0f1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.num-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.num-btn.clear {
    background: rgba(231, 76, 60, 0.3);
    color: #e74c3c;
}

.num-btn.enter {
    background: rgba(46, 204, 113, 0.3);
    color: #2ecc71;
}

.restart-btn {
    display: block;
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    border: none;
    border-radius: 25px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.restart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.overlay.hidden {
    display: none;
}

.overlay-content {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
}

.overlay-content h2 {
    color: #2ecc71;
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.overlay-content p {
    color: #ecf0f1;
    font-size: 1.2rem;
    margin-bottom: 10px;
}

#newRecord {
    color: #f1c40f;
    font-weight: bold;
    animation: pulse 0.5s ease infinite alternate;
}

@keyframes pulse {
    from { transform: scale(1); }
    to { transform: scale(1.1); }
}

.overlay-content button {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.2rem;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
}

.overlay-content button:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(39, 174, 96, 0.5);
}

@media (max-width: 450px) {
    .game-container {
        padding: 15px;
    }

    .game-header h1 {
        font-size: 2rem;
    }

    .num-btn {
        padding: 12px;
        font-size: 1.3rem;
    }

    #guessInput {
        font-size: 1.2rem;
    }
}
