/* gulab music — dark + rose */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #090909; --panel: #121014; --panel2: #181418; --line: #241f26;
  --txt: #f0f0f0; --dim: #9a929e; --faint: #6b6470;
  --rose: #fb7185; --rose-deep: #e11d48; --ok: #4ade80; --warn: #fbbf24; --bad: #f87171;
}
html, body { background: var(--bg); color: var(--txt); font: 15px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; min-height: 100%; }
#app { max-width: 860px; margin: 0 auto; padding: 20px 20px 80px; }

.top { display: flex; justify-content: space-between; align-items: center; padding: 6px 0 26px; }
.brand { font-weight: 700; font-size: 18px; letter-spacing: -0.02em; cursor: pointer; }
.brand span { color: var(--rose); }
.top-right { display: flex; gap: 8px; }

.hero { text-align: center; padding: 34px 0 26px; }
.hero.compact { padding: 10px 0 20px; }
.hero h1 { font-size: clamp(28px, 5vw, 44px); font-weight: 750; letter-spacing: -0.03em; line-height: 1.12; }
.hero h1 em { color: var(--rose); font-style: normal; }
.hero .sub { color: var(--dim); margin-top: 14px; font-size: 16px; max-width: 480px; margin-left: auto; margin-right: auto; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px; margin: 0 auto 16px; }
.auth-card { max-width: 400px; }
.create-card { max-width: 620px; }
.card-title { font-weight: 650; margin-bottom: 12px; font-size: 15px; }

label { display: block; font-size: 13px; color: var(--dim); margin: 16px 0 7px; font-weight: 550; }
label:first-child { margin-top: 0; }
label .opt { color: var(--faint); font-weight: 400; }
input, textarea {
  width: 100%; background: var(--panel2); color: var(--txt); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 14px; font: inherit; resize: vertical; outline: none;
}
input:focus, textarea:focus { border-color: var(--rose-deep); }
#code { font-size: 24px; letter-spacing: 10px; text-align: center; }

button { font: inherit; cursor: pointer; border: none; border-radius: 10px; }
.primary {
  width: 100%; background: linear-gradient(135deg, var(--rose-deep), var(--rose)); color: #fff;
  padding: 13px 18px; font-weight: 650; margin-top: 16px; transition: opacity .15s;
}
.primary:hover { opacity: .9; }
.primary:disabled { opacity: .45; cursor: default; }
.primary.big { font-size: 16px; padding: 15px; margin-top: 24px; }
.ghost { background: transparent; color: var(--dim); border: 1px solid var(--line); padding: 10px 16px; margin-top: 10px; }
.ghost:hover { color: var(--txt); border-color: var(--faint); }
.ghost.small { padding: 6px 12px; font-size: 13px; margin-top: 0; }
.btn-link { display: inline-block; text-align: center; text-decoration: none; width: auto; padding: 12px 26px; }

.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  background: var(--panel2); border: 1px solid var(--line); color: var(--dim); border-radius: 12px;
  padding: 10px 16px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; transition: all .12s;
}
.pill span { font-size: 11.5px; color: var(--faint); font-weight: 400; }
.pill.selected { border-color: var(--rose-deep); color: var(--txt); background: rgba(225, 29, 72, .08); }
#durPills .pill { flex-direction: row; padding: 10px 20px; font-weight: 600; }

.err { color: var(--bad); font-size: 13px; margin-top: 10px; min-height: 18px; }
.fine { color: var(--faint); font-size: 12.5px; text-align: center; margin-top: 12px; }

/* job dashboard */
.job-head { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 6px 2px 20px; }
.job-title { font-size: clamp(20px, 3.6vw, 30px); font-weight: 720; letter-spacing: -0.02em; }
.job-sub { color: var(--dim); font-size: 13.5px; margin-top: 5px; min-height: 20px; }
.ring-wrap { position: relative; width: 80px; height: 80px; flex: none; }
.ring { width: 80px; height: 80px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 7; }
.ring-bg { stroke: var(--line); }
.ring-fg { stroke: var(--rose); stroke-linecap: round; stroke-dasharray: 213.6; stroke-dashoffset: 213.6; transition: stroke-dashoffset .8s ease; }
.ring-label { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; font-size: 16px; }

.steps { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 16px; scrollbar-width: none; }
.steps::-webkit-scrollbar { display: none; }
.step { flex: 1; min-width: 108px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; }
.step .s-name { font-size: 12.5px; font-weight: 600; color: var(--faint); }
.step .s-state { font-size: 11px; color: var(--faint); margin-top: 3px; }
.step.active { border-color: var(--rose-deep); }
.step.active .s-name { color: var(--rose); }
.step.active .s-state { color: var(--dim); }
.step.done .s-name { color: var(--txt); }
.step.done .s-state { color: var(--ok); }
.step .dotline { display: flex; gap: 3px; margin-top: 8px; }
.step .dotline i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.step.active .dotline i { animation: pulse 1.2s infinite; background: var(--rose-deep); }
.step.active .dotline i:nth-child(2) { animation-delay: .2s; }
.step.active .dotline i:nth-child(3) { animation-delay: .4s; }
.step.done .dotline i { background: var(--ok); }
@keyframes pulse { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }

.track-card audio { width: 100%; margin-top: 4px; }

.board-head { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 2px; }
.board-sub { color: var(--faint); font-size: 12.5px; }
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.shot { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; position: relative; }
.shot .thumb { aspect-ratio: 16/9; background: var(--panel2); display: grid; place-items: center; position: relative; overflow: hidden; }
.shot .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot .thumb .ph { color: var(--faint); font-size: 20px; }
.shot .thumb.playable { cursor: pointer; }
.shot .thumb.playable::after { content: '▶'; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 22px; background: rgba(0,0,0,.25); opacity: 0; transition: opacity .15s; }
.shot .thumb.playable:hover::after { opacity: 1; }
.shot .meta { padding: 8px 10px; }
.shot .sec { font-size: 11px; color: var(--faint); }
.shot .time { font-size: 11.5px; color: var(--dim); font-variant-numeric: tabular-nums; }
.shot .state { position: absolute; top: 7px; right: 7px; font-size: 10px; font-weight: 650; padding: 3px 8px; border-radius: 999px; background: rgba(0,0,0,.55); backdrop-filter: blur(4px); }
.shot .state.wait { color: var(--faint); }
.shot .state.work { color: var(--warn); }
.shot .state.ok { color: var(--ok); }
.shot .state.mic { color: var(--rose); }
.shot.shimmer .thumb { background: linear-gradient(100deg, var(--panel2) 40%, #211c24 50%, var(--panel2) 60%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.final-card video { width: 100%; border-radius: 10px; background: #000; }
.final-card .row { display: flex; gap: 10px; align-items: center; margin-top: 14px; }
.fail-card { border-color: rgba(248, 113, 113, .35); }
.fail-card p { color: var(--dim); font-size: 14px; }

/* history */
.history { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.hist-item { display: flex; gap: 14px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px; cursor: pointer; transition: border-color .12s; }
.hist-item:hover { border-color: var(--faint); }
.hist-item .h-thumb { width: 96px; aspect-ratio: 16/9; border-radius: 8px; background: var(--panel2); object-fit: cover; flex: none; display: grid; place-items: center; color: var(--faint); overflow: hidden; }
.hist-item .h-thumb img { width: 100%; height: 100%; object-fit: cover; }
.hist-item .h-main { flex: 1; min-width: 0; }
.hist-item .h-title { font-weight: 620; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-item .h-sub { font-size: 12.5px; color: var(--faint); margin-top: 2px; }
.hist-item .h-state { font-size: 12px; font-weight: 650; flex: none; }
.h-state.done { color: var(--ok); } .h-state.run { color: var(--warn); } .h-state.fail { color: var(--bad); } .h-state.q { color: var(--dim); }

.clip-modal { position: fixed; inset: 0; background: rgba(0,0,0,.82); display: grid; place-items: center; z-index: 50; padding: 20px; }
.clip-modal[hidden] { display: none; }
.clip-modal-inner { width: min(720px, 94vw); text-align: center; }
.clip-modal video { width: 100%; border-radius: 12px; background: #000; }

@media (max-width: 560px) {
  #app { padding: 14px 14px 60px; }
  .board { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); }
  .job-head { flex-direction: row; }
}
