:root {
  --bg: #14161c; --panel: #1d2029; --line: #343b4f; --fg: #dfe5f0; --sub: #8b94a8;
  --c0: #e0f0c8; --c1: #9cc27a; --c2: #4f8352; --c3: #1c3a2e; --warn: #e6a15c;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
body {
  font-family: ui-sans-serif, system-ui, "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif;
  line-height: 1.7; -webkit-tap-highlight-color: transparent;
}
a { color: var(--c1); }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px 56px; }
header.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0 8px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); }
.logo b { font: 700 24px/1 ui-monospace, Menlo, Consolas, monospace; letter-spacing: 2px; }
.logo i { display: inline-grid; grid-template-columns: repeat(2, 9px); gap: 2px; }
.logo i s { display: block; width: 9px; height: 9px; }
.logo i s:nth-child(1) { background: var(--c0); } .logo i s:nth-child(2) { background: var(--c1); }
.logo i s:nth-child(3) { background: var(--c2); } .logo i s:nth-child(4) { background: var(--c3); outline: 1px solid var(--c2); }
.tag { color: var(--sub); font-size: 14px; margin: 4px 0 22px; }
.btn {
  display: inline-block; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  color: var(--c3); background: var(--c1); border: 2px solid var(--c0); border-radius: 6px;
  padding: 9px 18px; box-shadow: 3px 3px 0 var(--c2); transition: transform .08s, box-shadow .08s;
}
.btn:hover { transform: translate(1px, 1px); box-shadow: 2px 2px 0 var(--c2); }
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--c2); }
.btn:disabled { opacity: .5; cursor: default; transform: none; box-shadow: 3px 3px 0 var(--c2); }
.btn.ghost { color: var(--fg); background: transparent; border-color: var(--line); box-shadow: 3px 3px 0 var(--line); }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.card { background: var(--panel); border: 2px solid var(--line); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; }
.card img { display: block; width: 100%; aspect-ratio: 160 / 144; image-rendering: pixelated; background: var(--c3); border-bottom: 2px solid var(--line); }
.card .nothumb { aspect-ratio: 160 / 144; background: var(--c3); border-bottom: 2px solid var(--line); }
.card .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card h3 { margin: 0; font: 700 15px/1.3 ui-monospace, Menlo, Consolas, monospace; letter-spacing: 1px; }
.card p { margin: 0; font-size: 13px; color: var(--sub); flex: 1; overflow-wrap: anywhere; }
.card .acts { display: flex; gap: 10px; align-items: center; margin-top: 6px; font-size: 13px; }
.card .acts a.play { font-weight: 700; }
.meta { color: var(--sub); font-size: 13px; margin: 2px 0; }
.empty { color: var(--sub); text-align: center; padding: 40px 0; }
.notice { background: #2a2418; border: 2px solid #5b4a26; color: var(--warn); border-radius: 8px; padding: 8px 12px; font-size: 13px; margin: 0 0 16px; }

/* つくる画面 */
label { display: block; font-weight: 700; margin: 18px 0 6px; font-size: 14px; }
textarea, input[type=password], input[type=text], input[type=number], select {
  width: 100%; font: inherit; color: var(--fg); background: var(--panel);
  border: 2px solid var(--line); border-radius: 6px; padding: 10px 12px;
}
textarea { min-height: 110px; resize: vertical; }
textarea:focus, input:focus, select:focus { outline: none; border-color: var(--c1); }
.count { text-align: right; font-size: 12px; color: var(--sub); }
.ideas { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ideas button { font: inherit; font-size: 12px; color: var(--fg); background: transparent; border: 2px solid var(--line); border-radius: 999px; padding: 3px 12px; cursor: pointer; }
.ideas button:hover { border-color: var(--c1); }
.two { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .two { grid-template-columns: 1fr; } }
.progress { margin-top: 24px; background: var(--panel); border: 2px solid var(--line); border-radius: 8px; padding: 18px; text-align: center; }
.progress .bar { display: flex; gap: 6px; justify-content: center; margin: 10px 0 4px; }
.progress .bar s { width: 14px; height: 14px; background: var(--c3); animation: blink 1.2s infinite; }
.progress .bar s:nth-child(2) { animation-delay: .15s; } .progress .bar s:nth-child(3) { animation-delay: .3s; } .progress .bar s:nth-child(4) { animation-delay: .45s; }
@keyframes blink { 0%, 100% { background: var(--c3); } 40% { background: var(--c1); } }
@media (prefers-reduced-motion: reduce) { .progress .bar s { animation: none; background: var(--c2); } }
.err { color: var(--warn); }

/* あそぶ画面 */
.stage { margin: 12px auto 0; max-width: 720px; border: 2px solid var(--line); border-radius: 8px; overflow: hidden; background: #0b0c10; }
.stage iframe { display: block; width: 100%; height: min(calc(100vh - 250px), 760px); min-height: 440px; border: 0; }
@supports (height: 100dvh) { .stage iframe { height: min(calc(100dvh - 250px), 760px); } }
.bar2 { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
h1.title { font: 700 22px/1.3 ui-monospace, Menlo, Consolas, monospace; letter-spacing: 1px; margin: 8px 0 0; text-align: center; }
.sub { text-align: center; color: var(--sub); font-size: 14px; margin: 2px 0 0; overflow-wrap: anywhere; }
.nav { display: flex; gap: 10px; flex-wrap: wrap; }

/* おんがく画面 */
h2 { font-size: 17px; margin: 28px 0 8px; }
h2 .meta { font-weight: 400; }
.songs { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.songs li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--panel); border: 2px solid var(--line); border-radius: 6px; padding: 6px 10px; }
.songs .use { margin-left: auto; font-size: 13px; }
.mini { font: inherit; font-size: 12px; color: var(--fg); background: transparent; border: 2px solid var(--line); border-radius: 6px; padding: 2px 10px; cursor: pointer; min-width: 84px; }
.mini.on, [data-play].on { border-color: var(--c1); color: var(--c1); }
.vol2 { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.vol2 label { margin: 0; font-weight: 400; }
input[type=range] { accent-color: var(--c1); }
.rights { font-size: 13px; line-height: 1.8; }
.form .opts { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; }
.form .opts label { font-weight: 400; font-size: 13px; margin: 6px 0 0; }
.form .opts input, .form .opts select { width: 140px; padding: 6px 8px; display: block; }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
label.check input { width: auto; margin: 0; }
.form .opts label.check { align-self: end; padding-bottom: 6px; }
input[type=file] { font: inherit; font-size: 13px; color: var(--sub); max-width: 100%; }
textarea.notes { min-height: 70px; font: 13px/1.6 ui-monospace, Menlo, Consolas, monospace; font-weight: 400; }
code { font: 12px ui-monospace, Menlo, Consolas, monospace; background: var(--panel); padding: 0 4px; border-radius: 3px; }
