:root {
  --bg: #f3f8f4;
  --panel: #ffffff;
  --text: #10231a;
  --muted: #486152;
  --primary: #0f8a4f;
  --primary-2: #0b6a3c;
  --stroke: #dbe9e0;
  --shadow: 0 16px 40px rgba(15, 58, 35, 0.12);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Be Vietnam Pro", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 18%, rgba(15, 138, 79, 0.18), transparent 35%),
    radial-gradient(circle at 80% 12%, rgba(255, 171, 77, 0.2), transparent 35%),
    var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.bg-glow {
  position: fixed;
  border-radius: 999px;
  filter: blur(72px);
  z-index: -1;
  opacity: 0.32;
}

.bg-glow-a {
  width: 360px;
  height: 360px;
  background: #21b36a;
  top: -70px;
  left: -110px;
}

.bg-glow-b {
  width: 420px;
  height: 420px;
  background: #ffc86b;
  right: -120px;
  bottom: -150px;
}

.container {
  width: min(860px, 92vw);
  margin: 48px auto;
  display: grid;
  gap: 18px;
  flex: 1;
}

.hero {
  animation: rise 560ms ease;
}

.badge {
  display: inline-block;
  margin: 0 0 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: #e7f5ec;
  color: var(--primary-2);
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 5.2vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.sub {
  margin-top: 10px;
  color: var(--muted);
}

.panel,
.result {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  animation: rise 700ms ease;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

textarea {
  width: 100%;
  border: 1px solid #bfd5c7;
  border-radius: 14px;
  padding: 12px;
  font: inherit;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-row {
  margin-top: 8px;
  display: flex;
  align-items: stretch;
  border: 1px solid #bfd5c7;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.input-inline {
  border: 0;
  border-radius: 0;
  margin: 0;
  min-height: 56px;
  resize: none;
  padding: 16px 18px;
}

.input-inline:focus {
  outline: none;
  border-color: transparent;
  box-shadow: none;
}

textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(15, 138, 79, 0.15);
}

.actions,
.download-actions {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  appearance: none;
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 8px 18px rgba(15, 138, 79, 0.35);
}

.btn-ghost {
  background: #eef4f0;
  color: #2a4033;
}

.btn-paste {
  margin: 8px;
  background: #d8e7ff;
  color: #21324a;
  border: 1px solid #4aa8ff;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-paste:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(74, 168, 255, 0.24);
}

.btn-paste.is-clear {
  background: #eef4f0;
  color: #2a4033;
  border-color: #cfdad3;
}

.btn-paste.is-clear:hover {
  box-shadow: 0 6px 12px rgba(42, 64, 51, 0.16);
}

.paste-icon {
  width: 15px;
  height: 15px;
  border-radius: 6px;
  border: 2px solid #2b3551;
  background: linear-gradient(135deg, #111826, #36435f);
  display: inline-block;
}

.btn-download {
  border-radius: 0;
  margin: 0;
  padding: 0 28px;
  min-width: 190px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: none;
}

.download-icon {
  font-size: 24px;
  line-height: 1;
}

.input-row .btn:hover {
  transform: none;
}

.status {
  margin-top: 10px;
  min-height: 20px;
  color: var(--muted);
}

.status.error {
  color: #b42318;
}

.meta h2 {
  margin: 0 0 6px;
  font-size: 20px;
}

.meta p {
  margin: 0 0 12px;
  color: var(--muted);
}

.preview-wrap video,
.preview-wrap img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: #000;
}

.preview-wrap .video-js {
  width: 100%;
  max-width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
}

.preview-wrap .video-js .vjs-tech {
  object-fit: cover;
}

.preview-wrap .video-js .vjs-big-play-button {
  border: 0;
  border-radius: 999px;
  width: 72px;
  height: 72px;
  line-height: 72px;
  top: 50%;
  left: 50%;
  margin-top: -36px;
  margin-left: -36px;
  background: rgba(0, 0, 0, 0.38);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.preview-wrap .video-js .vjs-big-play-button .vjs-icon-placeholder:before {
  line-height: 72px;
}


.site-footer {
  width: 100%;
  margin: 8px 0 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: #0b6a3c;
  font-weight: 700;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

details {
  margin-top: 14px;
}

pre {
  overflow: auto;
  background: #f5faf6;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 10px;
}

.hidden {
  display: none;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  .container {
    margin: 24px auto 40px;
  }

  .panel,
  .result {
    padding: 14px;
  }

  .input-row {
    flex-wrap: wrap;
  }

  .btn-download {
    width: 100%;
    min-height: 52px;
  }
}
