:root{
  --bg:#0b1220;
  --card:#111a2e;
  --text:#ffffff;
  --muted:rgba(255,255,255,.75);
  --border:rgba(255,255,255,.12);
  --primary:#2f7dff;
  --primary2:#19c37d;
  --danger:#ff4d4f;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family:"Be Vietnam Pro", system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: radial-gradient(1200px 800px at 50% 0%, #15224a, var(--bg));
  color:var(--text);
}

.app{min-height:100vh; display:flex; align-items:stretch; justify-content:center;}
.screen{display:none; width:min(1080px, 100%); padding:18px;}
.screen.active{display:block;}

.kv img{width:100%; border-radius:18px; border:1px solid var(--border); display:block;}
.copy{padding:18px 6px}
.copy h1{margin:14px 0 8px; font-size:28px}
.copy p{margin:0 0 16px; color:var(--muted)}

.topbar{
  display:grid;
  grid-template-columns: 120px 1fr 120px;
  gap:10px;
  align-items:center;
  margin-bottom:14px;
}
.topbar h2{margin:0; text-align:center; font-size:18px}

.grid{
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap:12px;
}
@media (min-width: 900px){
  .grid{grid-template-columns: repeat(3, 1fr);}
}
.tpl{
  border:1px solid var(--border);
  border-radius:16px;
  overflow:hidden;
  background:rgba(0,0,0,.12);
  cursor:pointer;
  position:relative;
}
.tpl img{width:100%; height:160px; object-fit:cover; display:block;}
.tpl .badge{
  position:absolute; top:10px; left:10px;
  background:rgba(0,0,0,.6);
  border:1px solid var(--border);
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
}
.tpl.selected{outline:3px solid var(--primary);}

.footer{margin-top:14px; display:flex; justify-content:flex-end}

.compose{display:grid; gap:14px;}
@media (min-width: 900px){
  .compose{grid-template-columns: 1.1fr .9fr;}
}
.preview-card{
  background:rgba(255,255,255,.04);
  border:1px solid var(--border);
  border-radius:18px;
  padding:12px;
}
.preview-card img{width:100%; border-radius:14px; border:1px solid var(--border); display:block;}
.preview-text{
  margin-top:10px;
  padding:12px 14px;
  border-radius:14px;
  border:1px dashed rgba(255,255,255,.22);
  background:rgba(0,0,0,.18);
  font-size:26px;
  line-height:1.25;
  min-height:84px;
  word-break:break-word;
}

.form{
  background:rgba(255,255,255,.04);
  border:1px solid var(--border);
  border-radius:18px;
  padding:14px;
}
.label{display:block; margin:8px 0 8px; color:var(--muted)}
textarea{
  width:100%;
  min-height:120px;
  resize:none;
  border-radius:14px;
  border:1px solid var(--border);
  background:rgba(0,0,0,.18);
  color:var(--text);
  padding:12px 12px;
  outline:none;
  font-size:16px;
}
.meta{display:flex; justify-content:flex-end; margin-top:6px; color:var(--muted); font-size:12px}

.fonts{display:grid; grid-template-columns: repeat(2, 1fr); gap:10px; margin-bottom:12px}
.font{
  border:1px solid var(--border);
  border-radius:14px;
  padding:10px 10px;
  cursor:pointer;
  background:rgba(0,0,0,.14);
}
.font.selected{outline:3px solid var(--primary2);}
.font .name{font-size:12px; color:var(--muted); margin-bottom:6px}
.font .sample{font-size:20px}

.btn{
  border:none;
  border-radius:14px;
  padding:12px 16px;
  font-weight:700;
  cursor:pointer;
}
.btn.primary{background:linear-gradient(90deg, var(--primary), #6aa3ff); color:white;}
.btn.ghost{background:transparent; border:1px solid var(--border); color:white;}
.btn:disabled{opacity:.5; cursor:not-allowed}

.hint{margin:10px 0 0; font-size:12px; color:var(--muted)}
.thanks{padding:40px 8px; text-align:center}
.thanks h2{font-size:28px; margin:0 0 10px}
.thanks p{color:var(--muted); margin:0 0 16px}
