/* ==================== Fonts & Reset ==================== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

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

:root {
  --primary-color: #667eea;
  --secondary-color: #764ba2;
  --success-color: #00D9A6;
  --danger-color: #FF6B6B;
  --warning-color: #FFD93D;
  --text-dark: #2D3436;
  --text-light: #636E72;
  --bg-light: #F8F9FA;
}

body {
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
}

/* ==================== Game Header ==================== */
.game-header {
  text-align: center;
  padding: 2rem 1rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.game-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: white;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.2);
}

.title-icon {
  font-size: 3rem;
  animation: spin 3s ease-in-out infinite;
}

@keyframes spin {
  0%, 100% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(10deg);
  }
}

.game-subtitle {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.9);
  margin: 0.5rem 0 0;
}

/* ==================== Game Layout ==================== */
.game-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  padding: 2rem 1rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  align-items: start;
}

/* ==================== Sidebar ==================== */
.sidebar {
  display: flex;
/* Author: SinceraXY */
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: 2rem;
}

.difficulty-section,
.stats-section {
  background: rgba(255, 255, 255, 0.95);
  padding: 1.5rem;
  border-radius: 15px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
  text-align: center;
}

/* Difficulty Buttons */
.difficulty-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.difficulty-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.5);
  border: 2px solid var(--text-light);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Poppins', sans-serif;
}

.difficulty-btn:hover {
  transform: translateX(3px);
  border-color: var(--primary-color);
  background: rgba(255, 255, 255, 0.9);
}

.difficulty-btn.active {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border-color: var(--primary-color);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.diff-emoji {
  font-size: 2rem;
}

.diff-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dark);
}

.difficulty-btn.active .diff-name,
.difficulty-btn.active .diff-range {
  color: white;
}

.diff-range {
  font-size: 0.85rem;
  color: var(--text-light);
  font-weight: 500;
}

/* Statistics */
.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: var(--bg-light);
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.stat-item:last-child {
  margin-bottom: 0;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-light);
  font-weight: 500;
}

.stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-color);
}

/* Reset Stats Button */
.reset-stats-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  margin-top: 1rem;
  background: rgba(255, 107, 107, 0.1);
  color: var(--danger-color);
  border: 2px solid var(--danger-color);
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Poppins', sans-serif;
}

.reset-stats-btn:hover {
  background: var(--danger-color);
  color: white;
  transform: translateX(3px);
}

.reset-stats-btn:active {
  transform: translateX(0);
}

.reset-stats-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

/* ==================== Main Game Area ==================== */
.game-main {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
}

/* Game Info */
.game-info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  width: 100%;
  max-width: 800px;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.95);
  padding: 1.25rem;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.info-icon {
  font-size: 2rem;
}

.info-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.info-label {
  font-size: 0.85rem;
  color: var(--text-light);
  font-weight: 500;
}

.info-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-dark);
}

/* Game Container */
.game-container {
  background: rgba(255, 255, 255, 0.95);
  padding: 2.5rem;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 800px;
  text-align: center;
}

.game-instruction {
  font-size: 1.3rem;
  color: var(--text-dark);
  margin-bottom: 2rem;
  font-weight: 600;
}

/* Input Area */
.input-area {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

#guessInput {
  flex: 1;
  font-size: 1.5rem;
  padding: 1rem 1.5rem;
  text-align: center;
  border: 3px solid var(--primary-color);
  border-radius: 12px;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  transition: all 0.3s ease;
}

#guessInput:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2);
}

#guessInput:disabled {
  background: var(--bg-light);
  cursor: not-allowed;
  opacity: 0.6;
}

/* Remove number input spinners */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.check-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  font-family: 'Poppins', sans-serif;
}

.check-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.check-btn:active {
/* Project: GameHub */
  transform: translateY(0);
}

.check-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-icon {
  font-size: 1.2rem;
}

/* Feedback Message */
.feedback-message {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 600;
  padding: 1rem;
  border-radius: 10px;
  margin-bottom: 1.5rem;
  animation: fadeIn 0.3s ease;
}

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

.feedback-message.success {
  background: rgba(0, 217, 166, 0.1);
  color: var(--success-color);
  border: 2px solid var(--success-color);
}

.feedback-message.error {
  background: rgba(255, 107, 107, 0.1);
  color: var(--danger-color);
  border: 2px solid var(--danger-color);
}

.feedback-message.warning {
  background: rgba(255, 217, 61, 0.1);
  color: var(--warning-color);
  border: 2px solid var(--warning-color);
}

.feedback-message.info {
  background: rgba(102, 126, 234, 0.1);
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

/* Guess History */
.guess-history {
  text-align: left;
  margin-top: 1.5rem;
}

.history-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 1rem;
}

.history-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-height: 60px;
}

.history-empty {
  color: var(--text-light);
  font-size: 0.95rem;
  text-align: center;
  width: 100%;
}

.history-item {
  padding: 0.5rem 1rem;
  background: var(--bg-light);
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.history-item.high {
  background: rgba(255, 217, 61, 0.2);
  color: var(--warning-color);
}

.history-item.low {
  background: rgba(102, 126, 234, 0.2);
  color: var(--primary-color);
}

/* New Game Button */

/* Made with love */

.new-game-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  background: rgba(255, 255, 255, 0.95);
  color: var(--text-dark);
  border: 2px solid transparent;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  font-family: 'Poppins', sans-serif;
}

.new-game-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  border-color: var(--danger-color);
  color: var(--danger-color);
}

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

.new-game-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

/* ==================== Victory Modal ==================== */
.victory-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.victory-modal.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background: white;
  padding: 3rem 2.5rem;
  border-radius: 25px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  transform: scale(0.8);
  transition: transform 0.3s ease;
  max-width: 450px;
  width: 90%;
}

.victory-modal.active .modal-content {
  transform: scale(1);
  animation: modalBounce 0.6s ease;
}

@keyframes modalBounce {
  0% {
    transform: scale(0.3) rotate(-5deg);
  }
  50% {
    transform: scale(1.05) rotate(2deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

.modal-icon {
  font-size: 6rem;
  margin-bottom: 1rem;
  animation: iconSpin 1s ease;
}

@keyframes iconSpin {
  0% {
    transform: scale(0) rotate(0deg);
  }
  50% {
    transform: scale(1.2) rotate(180deg);
  }
  100% {
    transform: scale(1) rotate(360deg);
  }
}

.modal-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin: 0 0 0.5rem;
  background: linear-gradient(135deg, var(--success-color), var(--primary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.modal-title.defeat {
  background: linear-gradient(135deg, var(--danger-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.modal-message {
  font-size: 1.2rem;
  color: var(--text-light);
  margin: 0 0 2rem;
}

.modal-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--bg-light);
  border-radius: 15px;
}

/* Created by SinceraXY */

.modal-stat {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.modal-stat-label {
  font-size: 0.9rem;
  color: var(--text-light);
  font-weight: 600;
  text-transform: uppercase;
}

.modal-stat-value {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary-color);
}

/* Developer: SinceraXY */

.modal-btn {
  padding: 1rem 2.5rem;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  font-family: 'Poppins', sans-serif;
}

.modal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

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

/* ==================== Responsive Design ==================== */
@media screen and (max-width: 1024px) {
  .game-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .sidebar {
    position: static;
    flex-direction: row;
  }

  .difficulty-buttons {
    flex-direction: row;
  }

  .game-info {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media screen and (max-width: 768px) {
  .game-title {
    font-size: 2rem;
  }

  .title-icon {
    font-size: 2.5rem;
  }

  .sidebar {
    flex-direction: column;
  }

  .difficulty-buttons {
    flex-direction: column;
  }

  .game-info {
    grid-template-columns: 1fr;
  }

  .input-area {
    flex-direction: column;
  }

  .check-btn {
    width: 100%;
    justify-content: center;
  }
}

@media screen and (max-width: 480px) {
  .game-header {
    padding: 1.5rem 1rem;
  }

  .game-title {
    font-size: 1.75rem;
    flex-direction: column;
    gap: 0.5rem;
  }

  .game-subtitle {
    font-size: 1rem;
  }

  .game-container {
    padding: 1.5rem;
  }

  .modal-stats {
    flex-direction: column;
    gap: 1rem;
  }
}
