/* CodeMotion v0.1 — comic-book look from the X7 Hero Comic style:
   newsprint #f4ecd6, ink #141414, comic red #e23b2e, yellow #ffd43b, blue #2a6fdb. */
:root {
  --paper: #f4ecd6; --ink: #141414; --red: #e23b2e; --yellow: #ffd43b;
  --blue: #2a6fdb; --cyan: #59c3e8; --white: #fffdf6;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: Inter, "Noto Sans Myanmar", system-ui, sans-serif;
  background-image: radial-gradient(rgba(20,20,20,.14) 1px, transparent 1.4px);
  background-size: 14px 14px;
}
h1, h2, h3, .tab { font-family: Bangers, "Noto Sans Myanmar", cursive; letter-spacing: .04em; }
a { color: var(--blue); }

/* Hero */
.hero { background: var(--ink); color: var(--paper); border-bottom: 6px solid var(--red); padding: 28px 16px 24px; text-align: center; }
.hero-inner { max-width: 860px; margin: 0 auto; }
.kicker { color: var(--yellow); font-weight: 800; letter-spacing: .18em; font-size: 13px; margin: 0 0 6px; }
.hero h1 { font-size: clamp(56px, 12vw, 110px); line-height: .9; margin: 0; color: #fff; }
.hero h1 span { color: var(--red); -webkit-text-stroke: 2px #fff; }
.tagline { font-size: 18px; margin: 10px 0 2px; }
.tagline-mm { opacity: .85; margin: 4px 0 14px; }
.hero-cta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.key-note { font-size: 13px; opacity: .8; margin: 14px 0 0; }

/* Buttons */
.btn { font-family: Bangers, cursive; letter-spacing: .05em; font-size: 19px; cursor: pointer;
  border: 3px solid var(--ink); border-radius: 8px; padding: 8px 16px; background: var(--white); color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink); transition: transform .08s, box-shadow .08s; }
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.btn-red { background: var(--red); color: #fff; }
.btn-yellow { background: var(--yellow); }
.btn-small { font-size: 16px; padding: 5px 10px; box-shadow: 3px 3px 0 var(--ink); }
.btn-ghost { background: transparent; }
.btn-big { width: 100%; font-size: 24px; padding: 12px; margin-top: 10px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* Tabs */
.tabs { display: flex; justify-content: center; gap: 8px; padding: 12px 10px 0; flex-wrap: wrap; }
.tab { font-size: 20px; padding: 8px 18px; border: 3px solid var(--ink); border-bottom: none;
  border-radius: 10px 10px 0 0; background: #e9dcba; cursor: pointer; }
.tab.active { background: var(--yellow); }
main { max-width: 1180px; margin: 0 auto; padding: 0 12px 40px; }
.panel { display: none; background: var(--white); border: 3px solid var(--ink); border-radius: 0 12px 12px 12px;
  box-shadow: 6px 6px 0 var(--ink); padding: 18px; }
.panel.active { display: block; }

/* Browse */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar input[type="search"], .toolbar select { flex: 1 1 220px; }
input, select, textarea { font: inherit; padding: 10px 12px; border: 3px solid var(--ink); border-radius: 8px; background: #fff; width: 100%; }
input[type="checkbox"] { width: auto; padding: 0; border: none; accent-color: var(--red); transform: scale(1.3); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.count-line { font-weight: 700; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 12px; }
.card { border: 3px solid var(--ink); border-radius: 10px; overflow: hidden; background: #fff; cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink); transition: transform .1s; }
.card:hover { transform: translate(-2px, -2px); }
.card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; border-bottom: 3px solid var(--ink); background: #ddd; }
.card .noimg { aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center; background: var(--cyan);
  border-bottom: 3px solid var(--ink); font-family: Bangers, cursive; font-size: 44px; color: #fff; text-shadow: 2px 2px 0 var(--ink); }
.card-body { padding: 10px 12px; }
.card-body h3 { margin: 0 0 4px; font-size: 22px; }
.card-body p { margin: 0; font-size: 14px; }
/* Secondary original-Chinese name under the English display name. */
.zh { font-family: Inter, "Noto Sans Myanmar", system-ui, sans-serif; font-size: 13px; font-weight: 400; color: #666; letter-spacing: 0; }
.card-body p.zh { margin: 0 0 4px; }
.dialog-head h3 .zh { font-size: 15px; color: #555; }
.style-summary .zh { font-size: 13px; color: #666; }
.badge { display: inline-block; background: var(--yellow); border: 2px solid var(--ink); border-radius: 20px;
  font-size: 12px; font-weight: 800; padding: 1px 8px; margin-right: 4px; }
.badge.text-only { background: #e5e5e5; }

/* Generate layout */
.gen-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.gen-form h2, .gen-out h2 { font-size: 24px; margin: 16px 0 6px; border-bottom: 3px solid var(--yellow); display: inline-block; }
.gen-form h2:first-child { margin-top: 0; }
.settings-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.settings-grid label, .key-box label { font-size: 13px; font-weight: 700; display: block; }
.key-box { border: 3px dashed var(--ink); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.key-box input { font-family: monospace; }
.fine { font-size: 12px; color: #555; margin: 4px 0; }
.status { font-weight: 700; min-height: 1.2em; }
.status.err { color: var(--red); }
.status.ok { color: #0a7d2c; }
.style-summary { background: #fff8d6; border: 2px solid var(--ink); border-radius: 8px; padding: 8px 10px; font-size: 14px; margin-top: 8px; }
.stage { border: 3px solid var(--ink); border-radius: 10px; overflow: hidden; background: #000; box-shadow: 4px 4px 0 var(--ink); }
.stage iframe { width: 100%; aspect-ratio: 16/9; border: 0; display: block; background: #fff; }
.out-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.code-view { max-height: 300px; overflow: auto; background: #111; color: #d6ffd6; padding: 12px; border-radius: 8px; font-size: 12px; white-space: pre-wrap; }

/* How */
.steps li { margin-bottom: 10px; font-size: 16px; line-height: 1.5; }

/* Dialog */
dialog { border: 3px solid var(--ink); border-radius: 12px; box-shadow: 8px 8px 0 var(--ink); max-width: min(720px, 94vw); padding: 0; }
dialog::backdrop { background: rgba(20,20,20,.6); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--yellow); border-bottom: 3px solid var(--ink); }
.dialog-head h3 { margin: 0; font-size: 26px; }
#dlgBody { padding: 16px; max-height: 60vh; overflow: auto; }
#dlgBody img { width: 100%; border: 3px solid var(--ink); border-radius: 8px; }
#dlgBody pre { white-space: pre-wrap; background: #f6f0dc; border: 2px solid var(--ink); border-radius: 8px; padding: 10px; font-size: 13px; max-height: 260px; overflow: auto; }
.dialog-actions { display: flex; gap: 10px; padding: 12px 16px; border-top: 3px solid var(--ink); }

footer { text-align: center; font-size: 13px; padding: 18px; opacity: .8; }

@media (max-width: 820px) {
  .gen-layout { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 58px; }
  .hero h1 span { display: block; }
}
