:root {
  --page-glow: radial-gradient(circle at 50% -10%, rgba(132, 171, 255, 0.2), transparent 30%), radial-gradient(circle at 50% 110%, rgba(255, 136, 46, 0.24), transparent 26%), linear-gradient(180deg, #06101d 0%, #10243e 34%, #1f2734 62%, #501300 100%);
  --panel-surface: rgba(236, 228, 214, 0.88);
  --panel-surface-solid: rgb(236, 228, 214);
  --panel-border: rgba(197, 157, 110, 0.18);
  --default-surface: #f1f1f1;
  --text-cursor-black: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Crect x='7' y='1' width='1' height='14' fill='black'/%3E%3Crect x='5' y='1' width='5' height='1' fill='black'/%3E%3Crect x='5' y='14' width='5' height='1' fill='black'/%3E%3C/svg%3E") 8 8;
}

body {
  font-family: Arial, sans-serif;
  text-align: center;
  padding: 10px 50px 50px;
  margin: 0;
  min-height: 100vh;
  background-color: var(--default-surface);
  color: #000000;
  overflow-x: hidden;
  position: relative;
  transition: background-color 0.2s ease, color 0.2s ease;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  pointer-events: none;
  z-index: 0;
  filter: blur(14px);
  opacity: 0;
  transition: opacity 0.2s ease;
}

body::before {
  width: 32vw;
  height: 32vw;
  top: 6vh;
  left: -8vw;
  background: radial-gradient(circle, rgba(117, 146, 255, 0.3), transparent 68%);
}

body::after {
  width: 28vw;
  height: 28vw;
  right: -6vw;
  bottom: 12vh;
  background: radial-gradient(circle, rgba(255, 116, 0, 0.42), transparent 72%);
}

body.animations-enabled {
  background: var(--page-glow);
  color: #2f1000;
}

body.animations-enabled::before,
body.animations-enabled::after {
  opacity: 0.75;
}

.storm-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.2s ease;
}

body.animations-enabled .storm-canvas {
  opacity: 1;
}

.sky-flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  background: radial-gradient(circle at var(--flash-x, 50%) var(--flash-y, 18%), rgba(240, 247, 255, 0.82), rgba(184, 216, 255, 0.34) 24%, rgba(255, 255, 255, 0.06) 42%, rgba(255, 255, 255, 0) 62%);
  transition: opacity 0.18s ease-out;
}

.app-shell {
  position: relative;
  z-index: 2;
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 24px 64px;
}

#content {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  padding: 18px 20px 32px;
  background: var(--default-surface);
}

body.animations-enabled #content {
  background: var(--panel-surface);
  border: 1px solid var(--panel-border);
  border-radius: 28px;
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
}

.legal-notice {
  max-width: 540px;
  margin: 24px auto 0;
  font-size: 13px;
  line-height: 1.5;
  color: #4a4a4a;
  text-align: justify;
}

body.animations-enabled .legal-notice {
  color: #4a4a4a;
}

.footer-fire {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 0.96;
}

.footer-fire::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.26) 0%, rgba(0, 0, 0, 0.08) 16%, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.12) 74%, rgba(0, 0, 0, 0.2) 100%);
  pointer-events: none;
}

.footer-fire .fire-layer {
  position: absolute;
  inset: 0;
  will-change: transform, opacity;
  animation: fire-float 18s ease-in-out infinite, fire-breathe 11s ease-in-out infinite alternate;
}

.footer-fire .fire-layer img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  mix-blend-mode: screen;
}

.footer-fire .fire-layer.fire-layer-1 {
  opacity: 0.82;
  transform: scale(1.03) translate3d(0, 0, 0);
}

.footer-fire .fire-layer.fire-layer-1 img {
  filter: saturate(1.42) contrast(1.24) brightness(1.14);
}

.footer-fire .fire-layer.fire-layer-2 {
  opacity: 0.32;
  transform: scale(1.045) translate3d(0.4%, -0.4%, 0);
  animation-duration: 22s, 13.5s;
  animation-delay: -4.8s, -2.4s;
}

.footer-fire .fire-layer.fire-layer-2 img {
  filter: blur(0.35px) saturate(1.3) contrast(1.14) brightness(1.08);
}

.footer-fire .fire-layer.fire-layer-3 {
  opacity: 0.22;
  transform: scale(1.055) translate3d(-0.5%, 0.8%, 0);
  animation-duration: 26s, 15.5s;
  animation-delay: -9.4s, -5.6s;
}

.footer-fire .fire-layer.fire-layer-3 img {
  filter: blur(0.8px) saturate(1.18) contrast(1.08) brightness(1.02);
}

.footer-fire .fire-layer.fire-layer-4 {
  opacity: 0.14;
  transform: scale(1.065) translate3d(0.35%, 0.3%, 0);
  animation-duration: 30s, 17s;
  animation-delay: -12.8s, -7.3s;
}

.footer-fire .fire-layer.fire-layer-4 img {
  filter: blur(1px) saturate(1.12) contrast(1.04) brightness(1);
}

@keyframes fire-float {
  0% {
    transform: translate3d(-0.2%, 0.4%, 0) scale(1.02);
  }
  33% {
    transform: translate3d(0.3%, -0.3%, 0) scale(1.045);
  }
  67% {
    transform: translate3d(-0.25%, 0.9%, 0) scale(1.055);
  }
  100% {
    transform: translate3d(0.2%, -0.2%, 0) scale(1.03);
  }
}

@keyframes fire-breathe {
  0% {
    opacity: 0.34;
  }
  45% {
    opacity: 0.82;
  }
  100% {
    opacity: 0.52;
  }
}

input,
button {
  padding: 10px;
  margin: 10px 0;
  font-size: 16px;
}

.compact-button {
  padding: 6px 10px;
  font-size: 14px;
}

#pickButton {
  position: relative;
  z-index: 2;
  margin: 14px 0 0 0;
  min-width: 260px;
  padding: 12px 36px;
  font-size: 20px;
  font-weight: 700;
  text-transform: uppercase;
  color: #fff6ea;
  background: linear-gradient(180deg, #d35b24 0%, #b54a1e 58%, #8f3513 100%);
  border: none;
  border-radius: 999px;
  box-shadow: 0 12px 24px rgba(143, 53, 19, 0.28), inset 0 1px 0 rgba(255, 226, 196, 0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

#pickButton:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 28px rgba(143, 53, 19, 0.34), 0 0 0 3px rgba(255, 180, 120, 0.18), inset 0 1px 0 rgba(255, 226, 196, 0.4);
  filter: brightness(1.03);
}

#pickButton:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(143, 53, 19, 0.24), inset 0 1px 0 rgba(255, 226, 196, 0.22);
}

#namesFileInput {
  display: none;
}

.upload-row {
  margin-top: 8px;
  text-align: center;
}

.checkbox-row {
  margin-top: 8px;
  text-align: center;
}

.audio-row {
  margin-top: 2px;
  text-align: center;
}

.audio-controls {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.audio-volume {
  display: inline-flex;
  align-items: center;
  padding: 0;
  width: 170px;
}

.audio-volume input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 18px;
  background: transparent;
  cursor: pointer;
}

.audio-volume input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  background: rgba(61, 42, 28, 0.22);
  border-radius: 999px;
}

.audio-volume input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -7px;
  border: none;
  border-radius: 50%;
  background: #9db3e8;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.24);
}

.audio-volume input[type="range"]::-moz-range-track {
  height: 4px;
  background: rgba(61, 42, 28, 0.22);
  border: none;
  border-radius: 999px;
}

.audio-volume input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: #9db3e8;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.24);
}

.audio-volume input[type="range"]:focus {
  outline: none;
}

.audio-volume input[type="range"]:focus::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px rgba(157, 179, 232, 0.28), 0 1px 4px rgba(0, 0, 0, 0.24);
}

.audio-volume input[type="range"]:focus::-moz-range-thumb {
  box-shadow: 0 0 0 3px rgba(157, 179, 232, 0.28), 0 1px 4px rgba(0, 0, 0, 0.24);
}

.checkbox-row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #000000;
  cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
  margin: 0;
  padding: 0;
}

.audio-volume input[type="range"] {
  margin: 0;
  padding: 0;
}

textarea {
  overflow: hidden;
  resize: none;
  display: block;
  margin: 10px auto;
  width: 100%;
  max-width: 400px;
  cursor: var(--text-cursor-black), text;
  font-family: Arial, sans-serif;
  font-size: 16px;
  color: #352417;
  border: 1px solid rgba(126, 101, 77, 0.42);
  border-radius: 12px;
  padding: 10px;
  box-sizing: border-box;
  caret-color: #352417;
  background-color: rgba(255, 250, 244, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.46);
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

textarea:hover,
textarea:focus {
  cursor: var(--text-cursor-black), text;
}

textarea::placeholder {
  color: rgba(96, 70, 48, 0.68);
}

textarea:focus {
  outline: none;
  border-color: rgba(157, 179, 232, 0.7);
  caret-color: #352417;
  box-shadow: 0 0 0 3px rgba(157, 179, 232, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.46);
}

#namesBox {
  margin: 10px auto;
  width: 100%;
  max-width: 400px;
  border: 1px solid rgba(126, 101, 77, 0.42);
  border-radius: 12px;
  padding: 10px;
  box-sizing: border-box;
  background-color: rgba(255, 250, 244, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.46);
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

#namesBox:focus-within {
  border-color: rgba(157, 179, 232, 0.7);
  box-shadow: 0 0 0 3px rgba(157, 179, 232, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.46);
}

.result-line-display {
  display: none;
  margin: 0;
  padding: 0 0 5px;
  margin-bottom: 6px;
  text-align: left;
  font-family: Arial, sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #352417;
  border-bottom: 1px solid #999;
  word-break: break-word;
  overflow-wrap: break-word;
}

#namesBox.has-result .result-line-display {
  display: block;
}

#namesInput {
  margin: 0;
  width: 100%;
  max-width: none;
  border: none;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  caret-color: #352417;
}

#namesBox.drag-active {
  background-color: rgba(240, 245, 255, 0.94);
  border-color: rgba(93, 121, 181, 0.82);
  box-shadow: 0 0 0 3px rgba(157, 179, 232, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

#namesInput:focus {
  border-color: transparent;
  box-shadow: none;
}

#openFileButton {
  margin: 0;
  color: #f7f3ec;
  background: linear-gradient(180deg, #6f82a6 0%, #5e6f8f 58%, #4a5a77 100%);
  border: none;
  border-radius: 999px;
  box-shadow: 0 10px 18px rgba(58, 71, 96, 0.2), inset 0 1px 0 rgba(231, 238, 255, 0.24);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

#openFileButton:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 22px rgba(58, 71, 96, 0.24), 0 0 0 3px rgba(157, 179, 232, 0.16), inset 0 1px 0 rgba(231, 238, 255, 0.3);
  filter: brightness(1.03);
}

#openFileButton:active {
  transform: translateY(0);
  box-shadow: 0 7px 14px rgba(58, 71, 96, 0.18), inset 0 1px 0 rgba(231, 238, 255, 0.18);
}

#downloadPngButton,
#downloadJpgButton {
  color: #f7f3ec;
  background: linear-gradient(180deg, #6f82a6 0%, #5e6f8f 58%, #4a5a77 100%);
  border: none;
  border-radius: 999px;
  box-shadow: 0 10px 18px rgba(58, 71, 96, 0.2), inset 0 1px 0 rgba(231, 238, 255, 0.24);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

#downloadPngButton:hover,
#downloadJpgButton:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 22px rgba(58, 71, 96, 0.24), 0 0 0 3px rgba(157, 179, 232, 0.16), inset 0 1px 0 rgba(231, 238, 255, 0.3);
  filter: brightness(1.03);
}

#downloadPngButton:active,
#downloadJpgButton:active {
  transform: translateY(0);
  box-shadow: 0 7px 14px rgba(58, 71, 96, 0.18), inset 0 1px 0 rgba(231, 238, 255, 0.18);
}

.hero-image {
  display: block;
  margin: 20px auto 0;
  max-width: 100%;
  height: auto;
  border-radius: 22px;
  box-shadow: 0 18px 40px rgba(67, 15, 0, 0.18);
}

@media (max-width: 640px) {
  body {
    padding: 0;
  }

  .app-shell {
    padding: 12px 12px 140px;
  }

  #content {
    padding: 14px 14px 28px;
  }

  body.animations-enabled #content {
    border-radius: 22px;
  }
}
