@import url("https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap");

body {
  margin: 0;
  padding: 0;
  font-family: "Space Mono", monospace;
  background: #d3d3d3;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.item-content {
  position: relative;
  width: 480px;
  padding: 34px;
  text-align: left;
  background: #e8e8e8;
  border: 3px solid #808080;
  box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.25);
}

.item-content h2 {
  margin: 0 0 16px 0;
  font-size: 30px;
  color: #404040;
  font-weight: normal;
}

.item-content label {
  display: block;
  margin: 18px 0 10px 0;
  font-size: 19px;
  color: #505050;
}

.slider-container {
  position: relative;
  margin: 18px 0;
}

.slider-value {
  position: absolute;
  top: -45px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 60px;
  padding: 6px 12px;
  font-size: 17px;
  font-weight: bold;
  color: #404040;
  background: #e8e8e8;
  border: 1px solid #a0a0a0;
  text-align: center;
}

.item-content input[type="range"] {
  margin-top: 12px;
  width: 100%;
  height: 10px;
  appearance: none;
  -webkit-appearance: none;
  background: linear-gradient(90deg, #0d6efd 0%, #66a8ff 100%);
  outline: none;
}

.item-content input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  background: #0a58ca;
  border: 3px solid #2f60a5;
  box-shadow: 0 0 6px rgba(102, 138, 188, 0.4);
  cursor: pointer;
}

.item-content input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  background: #64768f;
  border: 3px solid #aabdd7;
  box-shadow: 0 0 6px rgba(0, 64, 153, 0.4);
  cursor: pointer;
}

.item-content button {
  margin-top: 18px;
  padding: 14px 44px;
  background-color: #999;
  color: #fff;
  border: 3px solid #777;
  cursor: pointer;
  font-size: 19px;
  font-weight: bold;
  transition:
    background 0.2s ease,
    transform 0.1s ease;
}

.item-content button:hover {
  background-color: #888;
}

.item-content button:active {
  transform: translateY(1px);
}

.hover-overlay {
  margin-top: 16px;
  color: #666;
  font-size: 15px;
}

.feedback-message {
  margin-top: 12px;
  padding: 12px;
  font-size: 17px;
  border: 2px solid #999;
}

.feedback-message.error {
  background-color: #ddd;
  color: #555;
}

.feedback-message.warning {
  background-color: #e0e0e0;
  color: #555;
}

.feedback-message.hidden {
  display: none;
}

.mistake-counter {
  margin-top: 18px;
  padding: 16px;
  background: #d8d8d8;
  border: 3px solid #999;
  min-height: 72px;
}

.mistake-list {
  font-size: 15px;
  color: #444;
  line-height: 1.55;
}

.mistake-list div {
  margin: 8px 0;
  padding: 8px;
  background: #ccc;
  border-left: 4px solid #888;
}

.bottom-left-description {
  position: fixed;
  bottom: 10px;
  left: 10px;
  color: #5e6c84;
  font-size: 12px;
  transform: none !important;
  will-change: auto;
}

.bottom-left-description p {
  margin: 3px 0;
}

.hint-button {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 18px;
  height: 18px;
  background-color: #999;
  color: white;
  border: 2px solid #777;
  font-size: 7px;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hint-button:hover {
  background-color: #777;
}

.hidden-home {
  position: absolute;
  bottom: 10px;
  right: 10px;
  color: #5e6c84;
  font-size: 5px;
  text-decoration: none;
  opacity: 0.7;
}

.hidden-home:hover {
  color: #42526e;
  text-decoration: underline;
}

@media (max-width: 520px) {
  body {
    padding: 20px 16px;
    align-items: flex-start;
    box-sizing: border-box;
  }

  .item-content {
    width: 100%;
    padding: 24px 20px;
    box-sizing: border-box;
  }

  .item-content h2 {
    font-size: 22px;
  }

  .item-content label {
    font-size: 16px;
    margin: 14px 0 8px 0;
  }

  .slider-value {
    font-size: 14px;
    padding: 4px 8px;
    min-width: 48px;
  }

  .item-content button {
    font-size: 16px;
    padding: 12px 28px;
  }

  .feedback-message {
    font-size: 14px;
    padding: 10px;
  }

  .mistake-list {
    font-size: 13px;
  }

  .bottom-left-description {
    font-size: 10px;
  }
}

@media print {
  @page {
    margin: 0.75in;
  }

  body * {
    visibility: hidden;
  }

  .item-content,
  .item-content * {
    visibility: visible;
  }

  .item-content {
    position: absolute;
    inset: 0;
    width: auto;
    border: none;
    box-shadow: none;
    background: white;
    padding: 0;
  }

  .hint-button,
  .hover-overlay,
  .feedback-message,
  .bottom-left-description,
  .hidden-home,
  input,
  label,
  h2,
  button {
    display: none !important;
  }

  .mistake-counter {
    border: 2px solid #666;
    background: #fff;
    padding: 16px;
  }
}
