* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-size: 62.5%;
}

body {
  background-color: #fff0f7;
  padding: 20px;
}

.container {
  max-width: 700px;
  margin: 0 auto;
  background-color: #ffd5e9;
  padding: 20px;
  border-radius: 20px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}
h1 {
  text-align: center;
  font-size: 42px;
  font-weight: bold;
  margin-bottom: 25px;
  font-family: "Gabarito", sans-serif;

  background-color: #8c516da6;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

h2 {
  text-align: left;
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 15px;
  font-family: "Gabarito", sans-serif;
  padding-left: 30px;
  background-color: #8c516da6;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.simulation-container {
  max-width: 600px;
  margin: 0 auto;

  background-color: #fff0f738;
  border-radius: 20px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  padding: 30px;
}

.info-container {
  display: flex;
  gap: 15px;
  justify-content: space-between;
  margin-bottom: 20px;
}

.info-box {
  flex: 1;
  background-color: #ffffff61;
  border-radius: 8px;
  padding: 10px 10px;
  text-align: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}
#tip .hover-text {
  position: absolute;
  display: flex;
  top: 70%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: 0.2s;
  text-align: center;
  font-size: 14px;
  font-family: "Gabarito", sans-serif;
}
#tip:hover .info-title,
#tip:hover .tip-icon {
  opacity: 0;
}

#tip:hover .hover-text {
  opacity: 1;
}

.info-title {
  font-size: 10px;
  margin-bottom: 8px;
  text-transform: uppercase;
  font-weight: bold;
  font-family: "Gabarito", sans-serif;
  background-color: #8c516d8b;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.info-text {
  font-size: 20px;
  font-family: "Gabarito", sans-serif;
  font-weight: bold;
  color: #8c516da6;
}

.tip-icon {
  font-size: 18px;
}

.seesaw-container {
  background-color: #ffffff61;
  border-radius: 20px;
  padding: 40px 15px 15px;
  min-height: 100px;
  position: relative;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.seesaw {
  margin-top: 115px;
  margin-bottom: 50px;
  position: relative;
  width: 100%;
  justify-content: center;
  align-items: flex-end;
  flex: 1;
}

.plank {
  border-radius: 4px;
  background-color: #984f1a;
  width: 400px;
  height: 20px;
  position: relative;
  z-index: 2;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.plank-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;

  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.pivot-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.pivot {
  border-bottom: 50px solid #9f8fe79f;
  border-left: 20px solid transparent;
  border-right: 20px solid transparent;
}

.button-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  padding: 15px;
  margin: 15px auto;
  width: 100%;
  max-width: 600px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 16px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.reset-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 12px 24px;
  background-color: #6f6c6ea6;
  color: white;
  border: none;
  border-radius: 20px;
  font-size: 16px;
  font-weight: 500;
  font-family: "Gabarito", sans-serif;
  cursor: pointer;
  transition: background-color 0.2s;
}

.reset-button:hover {
  background-color: #52525238;
}

.reset-icon {
  width: 18px;
  height: 18px;
  transition: transform 0.6s ease;
}

button:active .reset-icon {
  transform: rotate(-360deg);
}

.pause-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 12px 24px;
  background-color: #6f6c6ea6;
  color: white;
  border: none;
  border-radius: 20px;
  font-size: 16px;
  font-weight: 500;
  font-family: "Gabarito", sans-serif;
  cursor: pointer;
  transition: background-color 0.2s;
}
.pause-button.paused {
  background-color: #b55d80ae;
}
.pause-button:hover {
  background-color: #52525238;
}

.pause-icon {
  width: 18px;
  height: 18px;
}

.undo-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 12px 24px;
  background-color: #6f6c6ea6;
  color: white;
  border: none;
  border-radius: 20px;
  font-size: 16px;
  font-weight: 500;
  font-family: "Gabarito", sans-serif;
  cursor: pointer;
  transition: background-color 0.2s;
}

.undo-button:hover {
  background-color: #52525238;
}

.undo-icon {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
}

button:active .undo-icon {
  transform: rotate(-90deg);
}

.history-header,
.history-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
  align-items: center;
  flex: 1;
  border-radius: 8px;
  padding: 10px 10px;
  margin-bottom: 7px;

  font-family: "Gabarito", sans-serif;
}
.history-row {
  background-color: #cbb7c5;
  font-size: 20px;
  color: #ffe9f4;
  border-radius: 20px;
}
.history-header {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);

  font-weight: bold;
  font-size: 20px;
  background-color: #eac2cf;
  color: #7e7075c6;
  position: sticky;
  top: 0;
  z-index: 10;
  border-radius: 20px;
}

.history-container {
  background-color: #f8dced;
  border-radius: 20px;
  min-height: 200px;
  padding: 20px;
  max-width: 600px;
  margin: 0 auto;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  max-height: 300px;
  overflow: hidden;
}

#history-list {
  max-height: 220px;
  overflow-y: auto;
  background-color: #f8dced;
  scrollbar-width: none;
}

#history-list::-webkit-scrollbar {
  display: none;
}

.preview-line {
  position: fixed;
  width: 0;
  border-left: 2px dashed rgba(101, 76, 90, 0.5);
  pointer-events: none;
  transform-origin: top;
}
.preview-circle {
  border-radius: 50%;
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
  color: #333;
  display: flex;
}
.distance-label {
  position: absolute;
  top: 0%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: 700;
  line-height: 1;
  color: #272226c3;
  white-space: nowrap;
  user-select: none;
  font-family: "Gabarito", sans-serif;
}
.ball-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: 700;
  line-height: 1;
  color: #91808fc3;
  white-space: nowrap;
  user-select: none;
  font-family: "Gabarito", sans-serif;
}

.placed-ball {
  transform: translate(-50%, -100%);
  pointer-events: none;
  z-index: 3;
  position: absolute;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 10px;
  font-weight: bold;
  color: #333;

  user-select: none;
}

@media (max-width: 768px) {
  .info-boxes {
    flex-direction: column;
  }

  .plank {
    width: 100%;
    max-width: 400px;
  }
}
