* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(135deg, #0f0f1a, #1a1a2e);
  color: #f0f0f5;
  min-height: 100vh;
  display: flex;
  /* Ubah align-items jadi flex-start biar nempel ke atas */
  align-items: flex-start; 
  justify-content: center;
  padding: 30px 20px;
}

.container {
  width: 100%;
  max-width: 480px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 28px 24px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  /* Tambahan biar transisi pas video muncul lebih halus */
  transition: all 0.3s ease;
}

h1 {
  font-size: 1.5rem;
  text-align: center;
  background: linear-gradient(90deg, #ff2d55, #ff8a00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  text-align: center;
  font-size: 0.85rem;
  color: #aaa;
  margin: 8px 0 20px;
}

.input-group {
  display: flex;
  gap: 10px;
}

input[type="text"] {
  flex: 1;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font-size: 0.95rem;
  outline: none;
}

input[type="text"]:focus {
  border-color: #ff2d55;
}

button {
  padding: 12px 20px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(90deg, #ff2d55, #ff8a00);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s, transform 0.1s;
}

button:hover {
  opacity: 0.9;
}

button:active {
  transform: scale(0.97);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#result {
  margin-top: 20px;
  text-align: center;
  font-size: 0.9rem;
  color: #cfcfd8;
  word-break: break-word;
}

/* UPDATE DI SINI: Batasi tinggi video maksimal 40% layar */
#result video {
  max-width: 100%;
  max-height: 40vh; /* vh = viewport height */
  object-fit: contain; /* Biar video nggak gepeng */
  border-radius: 12px;
  margin: 0 auto 12px;
  display: block;
  background: #000;
}

#result .actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

#result .actions a button {
  width: 100%;
}

.error {
  color: #ff6b6b;
}
