/* ==== CSS Variables ==== */
:root {
  --bg-color: #1d3549;
  --bg-color-alt: #2b506e;
  --button-color-green: #27ae60;
  --button-color-red: #c0392b;
  --text-color: white;
  --text-color-alt: lightgray;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  --shadow-button: 0 2px 8px rgba(0, 0, 0, 0.6);
  --font-family: 'Roboto', sans-serif;
}

/* ==== Global Reset ==== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  /* outline: 1px red dashed; */
}

html, body {
  overflow: hidden;
}

/* ==== App Layout ==== */
body {
  background-color: var(--bg-color);
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.app {
  width: 370px;
  max-width: 370px;
  height: 640px;
  max-height: 640px;
  position: relative;
  background-color: var(--bg-color-alt);
  box-shadow: var(--shadow);
  border-radius: 12px;
  color: var(--text-color);
  font-family: var(--font-family);
  margin: 10px;
}

/* ==== Header ==== */
.header {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-color);
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.header-title {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  text-shadow: 2px 2px 4px black;
}

.header-content {
  height: 110px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
}

.control-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.control-group label {
  margin-right: 5px;
}

.control-group select {
  border: none;
  border-radius: 5px;
}

.button-group {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 60px;
}

.button-group button {
  font-size: 14px;
  padding: 5px 10px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s;
  box-shadow: var(--shadow-button);
}

#throwButton {
  color: var(--text-color);
  background: var(--button-color-green);
  box-shadow: var(--shadow-button);
}

#throwButton:hover {
  background: #2ecc71;
}

#clearButton {
  color: var(--text-color);
  background: var(--button-color-red);
  box-shadow: var(--shadow-button);
}

#clearButton:hover {
  background: #e74c3c;
}

/* ==== Main ==== */
.main {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

canvas {
  width: 350px;
  max-width: 100%;
  height: 350px;
  max-height: 100%;
  display: block;
  touch-action: none;
  background: var(--text-color);
  border-radius: 5px;
  box-shadow: var(--shadow-button);
}

#stats {
  height: 80px;
  display: flex;
  text-align: center;
  justify-content: center;
  gap: 20px;
  font-size: 12px;
  margin-top: 10px; 
}

/* ==== Footer ==== */
.footer {
  width: 100%;
  height: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--text-color-alt);
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  padding: 10px;
}

.footer-content {
  width: 100%;
  display: flex;
  justify-content: space-between;
}

.footer a {
  color: var(--text-color-alt);
  text-decoration: none;
}
