/* ダサウェブ★メーカー — エディタ */
:root {
  --bg: #f1efe9; --pane: #ffffff; --line: #e3ddd0; --line2: #ddd6c6;
  --ink: #26221c; --mute: #8a8271;
  --acc: #0044cc; --acc-d: #002e8a; --acc-l: #e9f0ff;
  --yel: #ffcc00; --danger: #c23a2b;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font-family: 'Zen Kaku Gothic New', 'Hiragino Sans', 'Yu Gothic', sans-serif;
  font-size: 13px; line-height: 1.6; -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--acc); }
.eyebrow { font-size: 11px; font-weight: 700; color: var(--mute); letter-spacing: .08em; display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.now { font-size: 11px; color: var(--mute); font-weight: 700; }
.sp { flex: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-weight: 700; font-size: 13px; padding: 9px 16px; border-radius: 8px; cursor: pointer;
  border: 2px solid var(--ink); background: #fff; color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink); transition: transform .08s, box-shadow .08s, background .15s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--acc-l); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.key { background: var(--acc); border-color: var(--acc-d); color: #fff; box-shadow: 3px 3px 0 var(--acc-d); }
.btn.key:hover { background: var(--acc-d); }
.btn.line { border-color: var(--acc); color: var(--acc); box-shadow: 3px 3px 0 var(--acc); }
.btn.mini { font-size: 12px; padding: 6px 10px; border-width: 1px; box-shadow: 2px 2px 0 var(--ink); border-radius: 6px; }
.btn.mini:active { box-shadow: 0 0 0 var(--ink); }
.btn.danger { border-color: var(--danger); color: var(--danger); box-shadow: 2px 2px 0 var(--danger); }

#app { display: grid; height: 100dvh; min-height: 480px; grid-template-columns: 380px 1fr; grid-template-rows: 58px 1fr; grid-template-areas: "top top" "editor stage"; }
#top { grid-area: top; display: flex; align-items: center; gap: 14px; padding: 0 18px; background: var(--pane); border-bottom: 3px solid transparent; border-image: repeating-linear-gradient(-45deg, var(--yel) 0 12px, var(--ink) 12px 24px) 3; }
.logo { margin: 0; font-family: 'DotGothic16', monospace; font-weight: 400; font-size: 23px; white-space: nowrap; }
.logo span { color: var(--acc); display: inline-block; animation: logostar 1.6s ease-in-out infinite; }
@keyframes logostar { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.35) rotate(20deg); } }
.tagline { margin: 0; font-size: 12px; color: var(--mute); white-space: nowrap; }
.topacts { margin-left: auto; display: flex; gap: 8px; align-items: center; }
#togglePrev { display: none; }

#editor { grid-area: editor; background: var(--pane); border-right: 1px solid var(--line); padding: 14px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.grp { border-top: 1px solid #eee8da; padding-top: 12px; }
.grp:first-child { border-top: 0; padding-top: 0; }
.seg { display: flex; flex-wrap: wrap; gap: 4px; }
.seg button { font-size: 11.5px; font-weight: 700; padding: 5px 9px; border-radius: 6px; border: 1px solid var(--line2); background: #fff; cursor: pointer; }
.seg button:hover { border-color: var(--acc); }
.seg button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.txt { display: flex; flex-direction: column; gap: 3px; font-size: 12px; font-weight: 700; margin-bottom: 8px; }
.txt input, .txt textarea { font-weight: 500; padding: 7px 8px; border: 1px solid var(--line2); border-radius: 6px; width: 100%; min-width: 0; background: #fff; }
.txt textarea { resize: vertical; line-height: 1.5; }
.txt.sub { margin-left: 22px; }
.row.sub3 { margin: 0 0 8px 22px; align-items: flex-end; }
.row.sub3 .txt { margin-bottom: 0; flex: 1; }
.row.sub3 .txt.colr { flex: 0 0 auto; }
.row.sub3 input[type=color] { width: 36px; height: 30px; padding: 1px 2px; border: 1px solid var(--line2); border-radius: 6px; background: #fff; }
.chk { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; margin-bottom: 8px; }
.chk input { accent-color: var(--acc); }
.chk .hint { font-weight: 400; color: var(--mute); font-size: 11px; }
.rng { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; margin-bottom: 8px; }
.rng span { color: var(--acc); }
.rng input[type=range] { width: 100%; accent-color: var(--acc); margin: 0; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.list { display: flex; flex-direction: column; gap: 6px; }
.lrow { display: flex; gap: 6px; align-items: center; }
.lrow input { flex: 1; min-width: 0; padding: 6px 8px; border: 1px solid var(--line2); border-radius: 6px; }
.lrow input.d { flex: 0 0 96px; }
.lrow input.u { flex: 0 0 34%; }
#news .lrow { flex-wrap: wrap; }
#news .lrow input.u { flex: 1 1 100%; }
.acts { display: flex; flex-wrap: wrap; gap: 8px; }
.acts .btn { flex: 1 1 auto; }
.about { display: flex; width: 100%; margin: 12px 0 10px; }
.flinks { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11px; }
.flinks a { color: var(--mute); text-decoration: none; }
.flinks a:hover { color: var(--acc); text-decoration: underline; }

#stage { grid-area: stage; display: flex; flex-direction: column; background: #dcd8cc; background-image: radial-gradient(#cfc9ba 1px, transparent 1px); background-size: 16px 16px; min-width: 0; }
.pbar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: rgba(255, 255, 255, .7); border-bottom: 1px solid var(--line); }
#preview { flex: 1; width: 100%; border: 0; background: #fff; }

#err { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--danger); color: #fff; font-weight: 700; padding: 10px 16px; border-radius: 8px; z-index: 70; }

@media (max-width: 1000px) { #app { grid-template-columns: 330px 1fr; } .tagline { display: none; } }
@media (max-width: 760px) {
  body { font-size: 14px; }
  input, select, textarea { font-size: 16px; }
  #app { height: auto; min-height: 100dvh; display: flex; flex-direction: column; }
  #top { position: sticky; top: 0; z-index: 12; flex-wrap: wrap; height: auto; padding: 8px 10px; gap: 6px 10px; }
  .logo { font-size: 19px; }
  .topacts { width: 100%; margin: 0; display: flex; gap: 5px; }
  .topacts .btn { flex: 1 1 auto; padding: 8px 4px; font-size: 12px; box-shadow: 2px 2px 0 var(--ink); }
  .topacts .btn.key { box-shadow: 2px 2px 0 var(--acc-d); }
  .topacts .btn.line { box-shadow: 2px 2px 0 var(--acc); }
  #undo, #redo { flex: 0 0 auto; }
  #togglePrev { display: inline-flex; }
  #editor { border-right: 0; padding: 12px 12px 24px; }
  #stage { display: none; min-height: calc(100dvh - 90px); }
  body.showPrev #editor { display: none; }
  body.showPrev #stage { display: flex; }
}
.note.small { font-size: 10.5px; line-height: 1.6; margin-top: 2px; }
.row.deco { margin: 0 0 8px; align-items: flex-end; }
.row.deco .txt { margin-bottom: 0; flex: 1; }
