@font-face { font-family: Vazirmatn; src: url(fonts/Vazirmatn-Regular.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url(fonts/Vazirmatn-Bold.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url(fonts/Vazirmatn-Black.woff2) format("woff2"); font-weight: 900; font-display: swap; }

:root {
  --bg: #14151c;
  --bg2: #1d1f2a;
  --card: #232633;
  --line: #343849;
  --text: #ecebe6;
  --muted: #a3a6b6;
  --red: #e5383b;
  --red-d: #a4161a;
  --yellow: #ffd166;
  --green: #2ec27e;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: Vazirmatn, Tahoma, system-ui, sans-serif; line-height: 1.8; font-size: 16px;
}
a { color: var(--yellow); }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .5em; }

.top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px;
  padding: 10px 20px; background: rgba(20, 21, 28, .92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 900; font-size: 18px; }
.links { display: flex; gap: 14px; margin-inline-start: auto; flex-wrap: wrap; }
.links a { color: var(--muted); text-decoration: none; font-size: 14px; }
.links a:hover { color: var(--text); }

main { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; padding: 56px 0 40px; }
.kicker { color: var(--red); font-weight: 700; margin: 0 0 6px; letter-spacing: .02em; }
.hero h1 { font-size: clamp(40px, 6vw, 68px); font-weight: 900; }
.lead { font-size: 19px; }
.lead2 { color: var(--muted); }
.hero-art { position: relative; border: 5px solid #000; border-radius: 6px; overflow: hidden; box-shadow: 10px 10px 0 var(--red-d); aspect-ratio: 1; }
.hero-art svg { display: block; width: 100%; height: 100%; }
.hero-bubble {
  position: absolute; top: 9%; right: 5%; background: #fff; color: #111; font-weight: 900;
  padding: 10px 18px; border: 3px solid #111; border-radius: 22px; font-size: clamp(15px, 2vw, 21px); max-width: 55%;
}
.hero-bubble::after {
  content: ""; position: absolute; bottom: -14px; left: 14%; width: 20px; height: 20px; background: #fff;
  border: 3px solid #111; border-top: 0; border-right: 0; transform: rotate(-30deg) skewX(20deg);
}

.btn {
  display: inline-block; font: inherit; font-weight: 700; color: var(--text); background: var(--card); border: 2px solid var(--line);
  border-radius: 10px; padding: 10px 18px; cursor: pointer; text-decoration: none; transition: transform .1s;
}
.btn:hover { transform: translateY(-1px); border-color: #555b72; }
.btn.primary { background: var(--red); border-color: #000; color: #fff; box-shadow: 4px 4px 0 #000; }
.btn.small { padding: 5px 12px; font-size: 14px; }
.btn.ghost { background: none; }

section { padding: 40px 0; }
.sec-head h2 { font-size: 32px; font-weight: 900; }
.sec-head p { color: var(--muted); margin-top: 0; }

.maker-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.preview { position: sticky; top: 72px; }
#comic { width: 100%; height: auto; display: block; border-radius: 6px; background: #000; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.status { min-height: 1.8em; color: var(--yellow); margin: 8px 0 0; font-size: 14px; }
.share-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; font-size: 14px; color: var(--muted); }

.controls label { display: block; font-size: 14px; color: var(--muted); }
.controls input:not([type]), .controls textarea, .controls select, .controls input[type="text"] {
  width: 100%; margin-top: 4px; font: inherit; font-size: 15px; color: var(--text); background: var(--bg2);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
}
.controls textarea { resize: vertical; min-height: 46px; }
.controls input:focus, .controls textarea:focus, .controls select:focus { outline: 2px solid var(--red); border-color: transparent; }
.row2 { display: grid; grid-template-columns: 1.5fr 1fr; gap: 12px; }
.row-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 12px 0; }
.check { display: flex !important; align-items: center; gap: 6px; color: var(--text) !important; cursor: pointer; }
.loss-quick { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font: inherit; font-size: 12px; background: var(--bg2); color: #ff8a8c; border: 1px solid var(--line); border-radius: 20px; padding: 1px 10px; cursor: pointer; direction: ltr; }
.chip:hover { border-color: var(--red); }

.panel-card { min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 14px; }
.panel-card h4 { margin: 0 0 8px; font-size: 15px; display: flex; justify-content: space-between; }
.scene-pick { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-bottom: 8px; }
.scene-pick button { min-width: 0; padding: 0; border: 3px solid transparent; border-radius: 6px; background: none; cursor: pointer; line-height: 0; }
.scene-pick button[aria-pressed="true"] { border-color: var(--red); }
.scene-pick img { width: 100%; height: auto; aspect-ratio: 1; border-radius: 3px; display: block; }
.panel-fields { display: grid; gap: 8px; }
.bubble-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.bubble-row select { width: auto !important; }

.story-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; }
.card h3 { color: var(--yellow); font-size: 19px; }
.card p { margin: 0; color: #d6d5d0; }

.token-card { max-width: 760px; }
.token-card p + p, .token-card div + p { margin-top: 12px; }
.ca { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.ca code { background: var(--bg2); padding: 6px 10px; border-radius: 8px; word-break: break-all; font-size: 14px; }
.warn { color: var(--muted) !important; font-size: 14px; border-inline-start: 3px solid var(--red); padding-inline-start: 12px; }

.foot { border-top: 1px solid var(--line); margin-top: 40px; padding: 30px 20px 40px; text-align: center; color: var(--muted); font-size: 14px; }
.foot .links { justify-content: center; margin: 0 0 12px; }
.foot p { margin: 4px 0; }
.disc { direction: ltr; }
.small-print { font-size: 12px; opacity: .7; }

@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-top: 28px; }
  .maker-grid { grid-template-columns: minmax(0, 1fr); }
  .preview { position: static; }
  .story-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  main { padding: 0 14px; }
  .top { padding: 8px 14px; gap: 10px; }
  .brand { font-size: 15px; }
  .brand img { width: 28px; height: 28px; }
  .links { gap: 10px; }
  .hero h1 { font-size: 38px; }
  .lead { font-size: 17px; }
  .hero-art { box-shadow: 6px 6px 0 var(--red-d); }
  .hero-bubble { font-size: 14px; padding: 6px 12px; }
  section { padding: 28px 0; }
  .sec-head h2 { font-size: 26px; }
  .row2 { grid-template-columns: minmax(0, 1fr); }
  .actions .btn { flex: 1 1 auto; text-align: center; padding: 10px 12px; }
  .panel-card { padding: 12px; }
  .bubble-row { grid-template-columns: minmax(0, 1fr); }
  .bubble-row select { width: 100% !important; }
  .card { padding: 16px 18px; }
}
[hidden] { display: none !important; }
