/* Dice Roller Game - Enhanced Styling */
:root {
  --primary-color: #6c5ce7;
  --secondary-color: #a29bfe;
  --accent-color: #fd79a8;
  --success-color: #00b894;
  --warning-color: #fdcb6e;
  --danger-color: #e17055;
  --dark-color: #2d3436;
  --light-color: #f9f9f9;
  --shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

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

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  background: -webkit-linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
}

.game-container {
  background-color: white;
  padding: 30px;
  border-radius: 20px;
  box-shadow: var(--shadow);
  text-align: center;
  width: 100%;
  max-width: 500px;
  position: relative;
  overflow: hidden;
}

.game-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: -webkit-linear-gradient(
    to right,
    var(--primary-color),
    var(--accent-color)
  );
  background: linear-gradient(
    to right,
    var(--primary-color),
    var(--accent-color)
  );
}

h1 {
  color: var(--dark-color);
  margin-bottom: 10px;
  font-size: 2.5rem;
  font-weight: 700;
  background: -webkit-linear-gradient(
    to right,
    var(--primary-color),
    var(--accent-color)
  );
  background: linear-gradient(
    to right,
    var(--primary-color),
    var(--accent-color)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: #666;
  margin-bottom: 30px;
  font-size: 1rem;
}

.dice-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 30px 0;
  gap: 30px;
  flex-wrap: wrap;
}

.die {
  width: 120px;
  height: 120px;
  background: #fff;
  border-radius: 16px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 15px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  transition: var(--transition);
  position: relative;
}

.dot {
  width: 22px;
  height: 22px;
  background: #e74c3c;
  border-radius: 50%;
  align-self: center;
  justify-self: center;
  display: none;
}

.die::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to bottom right,
    rgba(255, 255, 255, 0.3),
    rgba(255, 255, 255, 0)
  );
  transform: rotate(30deg);
}

.die.rolling {
  animation: roll 0.4s ease;
}

@keyframes roll {
  0% {
    transform: rotate(0deg) scale(1);
  }
  25% {
    transform: rotate(90deg) scale(1.1);
  }
  50% {
    transform: rotate(180deg) scale(1.05);
  }
  75% {
    transform: rotate(270deg) scale(1.1);
  }
  100% {
    transform: rotate(360deg) scale(1);
  }
}

.roll-button {
  padding: 14px 40px;
  font-size: 1.2rem;
  background: #e74c3c;
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 1px;
  transition: var(--transition);
  box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);
  margin-top: 10px;
  position: relative;
  overflow: hidden;
}

.roll-button:hover {
  background: #c0392b;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(231, 76, 60, 0.6);
}

.roll-button:active {
  transform: scale(0.96);
}

.roll-button::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s;
}

.roll-button:hover::after {
  left: 100%;
}

#result {
  margin: 25px 0;
  font-weight: bold;
  font-size: 1.4rem;
  min-height: 30px;
  padding: 15px;
  border-radius: 10px;
  background-color: #f8f9fa;
  transition: var(--transition);
}

.stats-container {
  display: flex;
  justify-content: space-around;
  margin-top: 30px;
  background-color: #f8f9fa;
  padding: 20px;
  border-radius: 15px;
  flex-wrap: wrap;
  gap: 15px;
}

.stat-box {
  flex: 1;
  min-width: 120px;
  padding: 15px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.stat-box h3 {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

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

.history-container {
  margin-top: 30px;
  text-align: left;
}

.history-container h3 {
  color: var(--dark-color);
  margin-bottom: 15px;
  font-size: 1.2rem;
}

#historyList {
  list-style-type: none;
  max-height: 150px;
  overflow-y: auto;
  padding: 10px;
  background-color: #f8f9fa;
  border-radius: 10px;
}

#historyList li {
  padding: 8px 12px;
  margin-bottom: 5px;
  background-color: white;
  border-radius: 5px;
  display: flex;
  justify-content: space-between;
  border-left: 4px solid var(--primary-color);
}

.key-hint {
  margin-top: 20px;
  color: #888;
  font-size: 0.9rem;
}

/* Responsive design */
@media (max-width: 600px) {
  .game-container {
    padding: 20px;
  }

  h1 {
    font-size: 2rem;
  }

  .die {
    width: 100px;
    height: 100px;
  }

  .dice-container {
    gap: 20px;
  }

  .stats-container {
    flex-direction: column;
  }

  .stat-box {
    min-width: 100%;
  }
}
