/* recorder.css — TOEIC Shadowing Recorder (Cloudflare Pages).
   Minimal, modern, responsive. Matches the TOEIC app design language. */
:root {
  --bg: #0b1020;
  --card: #151b2e;
  --card-2: #1b2340;
  --line: #2a3350;
  --text: #e8ecf6;
  --text-2: #9aa6c4;
  --acc: #4f46e5;
  --acc-2: #7c3aed;
  --ok: #22c55e;
  --warn: #f59e0b;
  --err: #ef4444;
  --rec: #ef4444;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Arial, sans-serif;
  min-height: 100%;
}
body { padding: 16px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.small { font-size: 12.5px; color: var(--text-2); }
.flex { display: flex; gap: 8px; align-items: center; }
.flex.between { justify-content: space-between; }
.flex.wrap { flex-wrap: wrap; }
.mt16 { margin-top: 16px; }
.mt8 { margin-top: 8px; }
.mt4 { margin-top: 4px; }

.hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; margin-bottom: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
}
.hd-title { font-size: 14px; color: var(--text-2); display: flex; gap: 8px; align-items: center; }
.hd-timer { font-size: 20px; font-weight: 700; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-2); display: inline-block; }
.dot.rec { background: var(--rec); animation: pulse 1s infinite; }
.dot.paused { background: var(--warn); }
.dot.done { background: var(--ok); }
.dot.uploading { background: var(--acc-2); animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.35} }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; margin-bottom: 12px;
}
.card h2, .card h3 { margin: 0 0 8px; font-size: 15px; }
.grid.c2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.sentence {
  font-size: 19px; line-height: 1.5; font-weight: 600; color: #fff;
  margin-top: 8px; min-height: 28px;
}
#lessonMeta { margin-bottom: 4px; }

/* Microphone */
.meter {
  height: 8px; background: #0f1526; border-radius: 6px; overflow: hidden; margin: 10px 0;
}
#meterFill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--acc), var(--acc-2)); transition: width 90ms linear; }

.input, .btn {
  appearance: none; -webkit-appearance: none;
  border: 1px solid var(--line); background: var(--card-2); color: var(--text);
  padding: 9px 12px; border-radius: 9px; font-size: 13.5px; cursor: pointer; font-family: inherit;
}
.input { cursor: default; }
input.input, select.input { width: 100%; }
.btn { transition: transform .05s ease, opacity .15s ease; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:not(:disabled):active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(135deg, var(--acc), var(--acc-2)); border: none; color: #fff; font-weight: 600; }
.btn.danger { background: linear-gradient(135deg, #dc2626, #ef4444); border: none; color: #fff; font-weight: 600; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 10px; font-size: 12.5px; }

.controls { display: flex; flex-wrap: wrap; gap: 8px; }
.meta .grid.c2 { align-items: center; }

.progress-track { height: 6px; background: #0f1526; border-radius: 5px; overflow: hidden; margin: 10px 0 6px; }
.progress-fill { height: 100%; width: 0%; background: var(--acc-2); transition: width 200ms ease; }

.empty-note { font-size: 12.5px; color: var(--text-2); margin-top: 4px; min-height: 14px; }

/* Toasts */
.toast-wrap { position: fixed; bottom: 16px; right: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast {
  background: var(--card-2); border: 1px solid var(--line); border-left: 3px solid var(--acc);
  padding: 10px 14px; border-radius: 8px; font-size: 13px; max-width: 320px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.toast.err { border-left-color: var(--err); }
.toast.ok { border-left-color: var(--ok); }

/* Responsive */
@media (max-width: 640px) {
  body { padding: 10px; }
  .grid.c2 { grid-template-columns: 1fr; }
  .sentence { font-size: 17px; }
  .controls { gap: 6px; }
  .btn { flex: 1 1 45%; }
}
