
* {
  box-sizing: border-box;
}

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

.game-container {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 40px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  max-width: 400px;
  width: 90%;
}

h1 {
  color: #fff;
  margin: 0 0 10px 0;
  font-size: 2rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.subtitle {
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 30px 0;
  font-size: 1rem;
}

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

input[type="number"] {
  flex: 1;
  padding: 15px 20px;
  font-size: 1.2rem;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  color: #1a1a2e;
  outline: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

input[type="number"]:focus {
  transform: scale(1.02);
  box-shadow: 0 0 20px rgba(79, 172, 254, 0.5);
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

button {
  padding: 15px 30px;
  font-size: 1rem;
  font-weight: bold;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.guess-btn {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: #1a1a2e;
}

.guess-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 20px rgba(79, 172, 254, 0.5);
}

.play-again-btn {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  color: #1a1a2e;
  margin-top: 20px;
  display: none;
}

.play-again-btn.visible {
  display: inline-block;
}

.play-again-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 20px rgba(67, 233, 123, 0.5);
}

.feedback {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px 0;
}

.feedback-message {
  font-size: 1.3rem;
  font-weight: bold;
  padding: 15px 25px;
  border-radius: 10px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.feedback-message.higher {
  background: rgba(255, 107, 107, 0.2);
  color: #ff6b6b;
  border: 1px solid rgba(255, 107, 107, 0.3);
}

.feedback-message.lower {
  background: rgba(79, 172, 254, 0.2);
  color: #4facfe;
  border: 1px solid rgba(79, 172, 254, 0.3);
}

.feedback-message.correct {
  background: rgba(67, 233, 123, 0.2);
  color: #43e97b;
  border: 1px solid rgba(67, 233, 123, 0.3);
}

.stats {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-top: 20px;
}

.stat {
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: bold;
  color: #fff;
}

.stat-label {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.history {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.history-title {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.history-guesses {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

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

.history-guess.higher {
  background: rgba(255, 107, 107, 0.2);
  color: #ff6b6b;
}

.history-guess.lower {
  background: rgba(79, 172, 254, 0.2);
  color: #4facfe;
}

.history-guess.correct {
  background: rgba(67, 233, 123, 0.2);
  color: #43e97b;
}
