:root {
  --primary-hue: 210;
  --primary-saturation: 100%;
  --primary-luminosity: 63%;
  --primary-color: hsl(
    var(--primary-hue),
    var(--primary-saturation),
    var(--primary-luminosity)
  ); /* Modifies the thematic color of the app */
  --bg-color: #222;
  --middle-color: #444;
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  background-color: var(--bg-color);
  color: #fff;
  text-align: center;
}

h1,
h2 {
  margin-bottom: 10px; /* Add a little space before start of content */
}

.clickable-text {
  cursor: pointer; /* Feedback for being able to click text */
  padding: 12px; /* Ease of use; slightly larger bounding box for clicking */
}

/* Makes the text unselectable so clicking on it will not highlight */
.unselectable {
  -webkit-user-select: none; /* For Safari */
  -moz-user-select: none; /* For Firefox */
  user-select: none; /* Standard syntax */
}

/* The generated name container */
#output {
  margin: 20px 10px 0 10px; /* Breathing room from title */
}

/* The generated name text */
#output-span {
  font-size: 42px; /* Big... */
  font-weight: bold; /* and bold */
  color: var(--primary-color); /* Draws attention to this area */
}

/* The rarity symbols under the name */
#rarity {
  color: var(--middle-color); /* Background detail */
  margin-bottom: 20px; /* Breathing room from selection buttons */
  font-size: 22px; /* Just large enough to see on my phone */
}

/* Selection buttons; generic design */
button {
  background-color: var(--middle-color);
  color: white;
  border: none;
  padding: 10px 20px;
  margin: 5px;
  cursor: pointer;
  font-size: 16px;
  border-radius: 2px;
  transition: background 0.3s ease, border-color 0.3s ease;
}

button:hover {
  background-color: #777; /* highlight the hovered button */
}

/* Match current selection to primary color */
button.selected {
  background-color: var(--primary-color);
  color: var(--bg-color);
  font-weight: bold;
  border: 2px solid var(--primary-color);
}

/* Used to keep generate button centered */
.generate-container {
  display: grid; /* Allows to center button in a center column */
  grid-template-columns: 1fr auto 1fr; /* small center; equal left and right */
  align-items: center;
  justify-items: center;
  gap: 10px; /* Gives just a tiny bit of room between button and dice */
  margin-top: 25px; /* Add some space from selection buttons */
}

/* The generate button */
#generate {
  grid-column: 2; /* Place in center column */
  margin-top: 10px;
  font-size: 28px;
  border-radius: 6px;
  border: 2px solid var(--primary-color);
}

/* Disabled until data loads; make it appear turned off */
#generate:disabled {
  border: 2px solid var(--middle-color);
  background-color: var(--bg-color);
  color: var(--middle-color);
  cursor: not-allowed;
}

/* Clear formatting for clickable emojis */
.emoji-button {
  background: none; /* clear formatting */
  padding: 8px;
}

.emoji-button:hover {
  background: none; /* clear formatting */
}

/* The dice icon */
#random {
  grid-column: 3; /* Place in right-side column */
  justify-self: left; /* Push the icon to the left */
  font-size: 28px; /* Same size as button text */
}

/* Rarity icon in the bottom-right corner */
#average-rarity {
  text-align: right; /* Push to the right */
  margin-right: 5vw; /* Give a little space from edge of screen */
  color: var(--middle-color); /* Don't draw attention to it */
  font-size: 20px; /* Just enough to easily distinguish circle and diamond */
}

/* Horizontal rule to separate app info from the app */
hr {
  margin-top: 15px; /* For giving space from the generate button */
  margin-bottom: 20px; /* Space until start of "about" content */
  width: 95vw; /* Almost to the edge of screen */
  height: 1px; /* Make it 1 pixel tall */
  border: none; /* To see only 1 pixel thick we have to hide border */
  background-color: var(--middle-color); /* Don't draw attention */
}

/* App information */
#about {
  color: var(--middle-color); /* Don't draw attention */
  margin: auto; /* Center the text */
  width: 85vw; /* Breathing room from edges of screen */
  text-align: left; /* Makes it look formal and not part of the app */
}

/* Hyperlinks */
a {
  color: hsl(
    var(--primary-hue),
    calc(var(--primary-saturation) * 2 / 3),
    calc(var(--primary-luminosity) * 4 / 5)
  ); /* Slightly darker than theme color */
  text-decoration: none; /* Remove underline */
}

a:hover {
  text-decoration: underline; /* Add underline while hovering */
}

a:visited {
  color: hsl(
    var(--primary-hue),
    calc(var(--primary-saturation) / 2),
    calc(var(--primary-luminosity) / 2)
  ); /* "Dim" compared to theme color; thanks for visiting my other work btw! */
}

a:active {
  color: var(--primary-color); /* Bright light of excitement */
}
