:root {
  --bg: #1f1f1f;
  --accent: #4caf50;
  --accent-hover: #2de036;
  --settings: rgb(23, 100, 126);
  --settings-hover: rgb(38, 162, 204);
  --text: white;
  --z-bg: 0;
  --z-ui: 1;
  --z-target: 2;
  --z-menu: 3;
  --z-modal: 10;
}

body {
  background-color: var(--bg);
  margin: 0;
  color: var(--text);
  overflow: hidden;
  font-family: Arial, Helvetica, sans-serif;
}

button,
#score-container,
#timer {
  color: var(--text);
}

.settings {
  background-color: var(--settings);
}
.settings:hover {
  background-color: var(--settings-hover);
}

.grid {
  position: absolute;
  width: 100vw;
  height: 100vh;
  background-color: var(--bg);
  background-image: linear-gradient(
      to right,
      rgba(255, 255, 255, 0.1) 1px,
      transparent 1px
    ),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 20px 20px;
  z-index: var(--z-bg);
}

button {
  padding: 6px 12px;
  margin: 10px;
  font-size: 16px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  background-color: var(--accent);
  transition: background-color 0.2s ease;
  z-index: var(--z-ui);
}
button:hover {
  background-color: var(--accent-hover);
}
button:focus {
  outline: 2px solid rgba(255, 255, 255, 0.15);
  outline-offset: 2px;
}

#startButton {
  position: fixed;
  top: 83%;
  transform: scale(3);
  z-index: var(--z-menu);
}
#statsButton {
  position: fixed;
  top: 70%;
  z-index: var(--z-ui);
}
#settingsButton {
  position: fixed;
  top: 75%;
  z-index: var(--z-ui);
}

.menu {
  user-select: none;
  -webkit-user-select: none; /* Safari */
  -moz-user-select: none; /* Firefox */
  -ms-user-select: none; /* IE10+/Edge */
  display: flex;
  position: relative;
  padding-top: 205px;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
  transition: background-color 0.3s ease;
  z-index: var(--z-menu);
}

.menu-container,
.stats-container,
.settings-container {
  display: flex;
  background-color: #2c2c2c;
  border: 2px solid var(--accent);
  border-radius: 12px;
  padding: 10px 30px 30px;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  z-index: var(--z-modal);
}

.stats-container,
.settings-container {
  position: fixed;
  min-width: 400px;
  min-height: 300px;
  z-index: var(--z-modal);
}

.setting-group {
  align-items: flex-start;
}

.stats-grid {
  display: flex;
  gap: 100px;
}

.menu-checkbox {
  display: flex;
  align-items: center;
}

#timer {
  position: fixed;
  bottom: 10px;
  right: 10px;
  font-family: monospace;
  font-size: 30px;
  opacity: 0.6;
  z-index: var(--z-ui);
}

#score-container {
  position: fixed;
  top: 10px;
  right: 10px;
  font-size: 30px;
  z-index: var(--z-ui);
}

#max-score {
  font-weight: bold;
  margin-bottom: 4px;
}
#score {
  user-select: none;
  font-weight: normal;
}

#target-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  z-index: var(--z-target);
}

.target {
  position: absolute;
  background-color: red;
  border-radius: 50%;
  cursor: pointer;
  z-index: 2;
}

.hit-effect {
  position: absolute;
  pointer-events: none;
  background-color: red;
  border-radius: 50%;
  opacity: 0.5;
  animation: pop 0.3s ease-out forwards;
  z-index: 4;
}

@keyframes pop {
  0% {
    transform: scale(1);
    opacity: 0.5;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

.slider {
  width: 100%;
  height: 25px;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.slider:hover {
  opacity: 1;
}

input[type="radio"] {
  display: block;
  margin: 10px 10px;
  font-size: 18px;
  cursor: pointer;
}

.chart-tabs {
  margin-top: 10px;
}
.chart-tab {
  margin-right: 5px;
  padding: 6px 12px;
  cursor: pointer;
}
.chart-box {
  margin-top: 20px;
}

.row {
  display: flex;
  flex-direction: row;
}

.centered {
  display: flex;
  align-items: center;
}
