:root {
  --teal: #04B9D2;
  --teal-dark: #0893a6;
  --ink: #111111;
  --paper: #ffffff;
  --muted: rgba(255,255,255,0.78);
  --red: #c0392b;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  min-height: 100dvh;
  font-family: Karla, system-ui, sans-serif;
  color: var(--paper);
  text-align: center;
  padding: 36px 20px calc(36px + env(safe-area-inset-bottom));
}
.bg {
  position: fixed;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.42) 0%, rgba(0,0,0,0.62) 55%, rgba(0,0,0,0.78) 100%),
    url("assets/hero.jpg") center / cover no-repeat;
  z-index: -1;
}
.screen { max-width: 420px; margin: 0 auto; }
.patch {
  width: 118px;
  height: 118px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  margin: 8px auto 14px;
}
.patch.small { width: 84px; height: 84px; margin-bottom: 10px; }
.handle {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
h1 {
  font-family: "Just Another Hand", cursive;
  font-weight: 400;
  font-size: 58px;
  line-height: 0.9;
  letter-spacing: 1px;
  margin: 0 0 10px;
}
.lede {
  margin: 0 auto 22px;
  max-width: 34ch;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}
.card {
  text-align: left;
  background: rgba(255,255,255,0.94);
  color: var(--ink);
  border-radius: 22px;
  padding: 18px 16px 16px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.28);
}
label, .label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 8px;
}
label span { text-transform: none; letter-spacing: 0; font-weight: 400; color: #667; }
input, textarea {
  width: 100%;
  border: 1.5px solid #d7e3e6;
  background: #fff;
  border-radius: 999px;
  padding: 13px 16px;
  margin-bottom: 14px;
  font: 16px/1.3 Karla, system-ui, sans-serif;
}
textarea {
  border-radius: 18px;
  min-height: 88px;
  resize: vertical;
}
button {
  width: 100%;
  border: 0;
  border-radius: 999px;
  background: var(--teal);
  color: #fff;
  padding: 15px 16px;
  font: 700 16px/1 Karla, system-ui, sans-serif;
  letter-spacing: 0.02em;
}
button:disabled { opacity: 0.45; }
.drop {
  display: block;
  border: 2px dashed var(--teal);
  background: rgba(4,185,210,0.08);
  color: var(--teal-dark);
  padding: 22px 14px;
  text-align: center;
  margin-bottom: 14px;
  border-radius: 18px;
  font-weight: 700;
}
.drop input { display: none; }
#preview {
  width: 100%;
  border-radius: 16px;
  margin: 0 0 12px;
  background: #111;
}
.frames {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.frames img {
  width: 100%;
  aspect-ratio: 9/16;
  object-fit: cover;
  border-radius: 10px;
}
.error { color: var(--red); font-size: 14px; margin: 10px 0 0; text-align: center; }
#result { margin-top: 16px; }
#result h2 {
  font-family: "Just Another Hand", cursive;
  font-size: 40px;
  font-weight: 400;
  margin: 8px 0 8px;
  color: var(--ink);
}
#result pre {
  white-space: pre-wrap;
  font: 14px/1.45 Karla, system-ui, sans-serif;
  background: #f4fbfc;
  padding: 14px;
  border-radius: 16px;
  margin: 0;
}
.ok {
  display: inline-block;
  background: var(--teal);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 9px;
  border-radius: 999px;
}
.foot {
  margin: 22px 0 0;
  font-family: "Just Another Hand", cursive;
  font-size: 28px;
  letter-spacing: 0.5px;
  color: rgba(255,255,255,0.9);
}
