body {
  text-align: center;
  margin: 0 auto;
  max-width: 1200px;
  min-height: 100vh;
  background: linear-gradient(135deg, rgb(34, 33, 33) 0%, rgb(28, 27, 27) 100%);
  color: white;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu,
    Cantarell, sans-serif;
  line-height: 1.6;
  padding: 1em 0;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 50%;
  right: -5%;
  background-image: url('static/ship.png');
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.03;
  transform: translateY(-50%) rotate(-15deg);
  pointer-events: none;
  z-index: 0;
}

main {
  flex: 1 0 auto;
  max-width: 600px;
  margin: 0 auto;
  width: 85%;
  padding: 0 1em;
  position: relative;
  z-index: 1;
}

h1 {
  font-size: 2.5em;
  font-weight: 300;
  letter-spacing: 0.05em;
  margin: 0.5em 0;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  position: relative;
  display: inline-block;
}

h1::after {
  content: '⛵';
  position: absolute;
  font-size: 0.4em;
  top: -0.5em;
  right: -1.5em;
  animation: sail 3s ease-in-out infinite;
  opacity: 0.7;
}

@keyframes sail {
  0%,
  100% {
    transform: rotate(-5deg) translateX(0);
  }
  50% {
    transform: rotate(5deg) translateX(10px);
  }
}

h4 {
  margin: 0 auto;
  color: white;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

button {
  margin: 1.5em auto;
  padding: 0.8em 3em;
  font-size: 1.1em;
  font-weight: 500;
  letter-spacing: 0.05em;
  background: linear-gradient(145deg, #8b1a1a, #6d1515);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 2em;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  background: linear-gradient(145deg, #9d1c1c, #7f1717);
  border-color: rgba(255, 255, 255, 0.2);
}

button:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.controls {
  background: linear-gradient(145deg, #3d3535, #322a2a);
  border: 1px solid rgba(139, 26, 26, 0.2);
  border-radius: 1.5em;
  padding: 1.5em;
  margin: 1em 0;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.config {
  display: inline-block;
  margin: 0 1em;
  vertical-align: top;
}

.label-group {
  display: block;
  margin-bottom: 0.5em;
}

.label {
  font-weight: 400;
  letter-spacing: 0.02em;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  font-size: 1em;
}

.emoji {
  margin-left: 0.5em;
  font-size: 1.2em;
  vertical-align: middle;
}

input[type='range'] {
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  outline: none;
  transition: all 0.3s ease;
}

input[type='range']:hover {
  background: rgba(255, 255, 255, 0.3);
}

input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: linear-gradient(145deg, #8b1a1a, #6d1515);
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

input[type='range']::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow:
    0 0 15px rgba(139, 26, 26, 0.6),
    0 2px 8px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.7);
}

input[type='range']::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: linear-gradient(145deg, #8b1a1a, #6d1515);
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

input[type='range']::-moz-range-thumb:hover {
  transform: scale(1.15);
  box-shadow:
    0 0 15px rgba(139, 26, 26, 0.6),
    0 2px 8px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.7);
}

.result {
  margin: 0.8em 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1.5em;
  padding: 1.5em 2em;
  background: linear-gradient(145deg, #363a3d, #2b2f32);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  min-height: 1.5em;
  position: relative;
  overflow: hidden;
  text-align: left;
}

.result:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.2);
}

.result:empty::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.result.loading:empty::after {
  opacity: 1;
}

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result:not(:empty) {
  animation: fadeIn 0.3s ease-out;
}

/* Footer styling */
footer {
  margin-top: 2em;
  padding: 2em 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9em;
}

footer .footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 600px;
  margin: 0 auto;
  padding: 0 1em;
}

footer a {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  transition: color 0.3s ease;
}

footer a:hover {
  color: rgba(255, 255, 255, 0.85);
}

@media screen and (max-width: 700px) {
  body {
    padding: 0.25em 0;
  }

  h1 {
    font-size: 2em;
    margin: 0.25em 0;
  }

  .controls {
    padding: 0.5em 0.75em;
    margin: 0.5em 0;
  }

  .config {
    display: flex;
    align-items: center;
    margin: 0.25em 0;
    gap: 0.5em;
  }

  .label-group {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 40%;
    margin-bottom: 0;
    margin-right: 1em;
  }

  .label {
    font-size: 0.95em;
  }

  input[type='range'] {
    width: 50%;
  }

  button {
    padding: 0.7em 2em;
    font-size: 1em;
    margin: 1em auto;
  }

  .result {
    margin: 0.5em 0;
    padding: 1em 1.5em;
  }

  footer {
    padding: 1.5em 0;
    margin-top: 1.5em;
  }
}
