:root{
  --glass: rgba(255,255,255,0.12);
  --glass-2: rgba(255,255,255,0.08);
  --stroke: rgba(255,255,255,0.22);
  --shadow: rgba(0,0,0,0.25);
  --text: rgba(10, 12, 20, 0.92);
  --muted: rgba(10, 12, 20, 0.65);
  --good: rgba(0, 160, 90, 0.9);
  --warn: rgba(220, 160, 0, 0.9);
  --bad: rgba(200, 60, 60, 0.95);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  background: radial-gradient(1200px 600px at 20% 20%, rgba(160,220,255,0.35), transparent 60%),
              radial-gradient(1200px 600px at 80% 70%, rgba(255,190,220,0.25), transparent 55%),
              rgba(240, 244, 248, 1);
}

.topbar{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.brand .title{
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.brand .subtitle{
  margin-top: 4px;
  color: var(--muted);
}

.props{
  display:flex;
  align-items:flex-end;
  gap: 10px;
  flex-wrap: wrap;
  justify-content:flex-end;
}
.props label{
  display:flex;
  flex-direction:column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}
.props input{
  width: 210px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.12);
  background: rgba(255,255,255,0.8);
  outline: none;
}

.layout{
  display:grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 14px;
  padding: 14px 16px;
  height: calc(100% - 74px - 42px);
}

.panel{
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  box-shadow: 0 14px 34px var(--shadow), inset 0 0 0 1px rgba(255,255,255,0.08);
  overflow: hidden;
  display:flex;
  flex-direction: column;
  min-height: 0;
}

.panel-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 12px 12px 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.16);
}
.panel h2{
  margin: 0;
  font-size: 16px;
}
.status{
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.35);
  border: 1px solid rgba(255,255,255,0.28);
}

.script-tools{
  display:flex;
  gap: 10px;
  align-items:center;
  flex-wrap: wrap;
  justify-content:flex-end;
}
.toggle{
  display:flex;
  align-items:center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  user-select:none;
}

.script{
  padding-bottom: 12px;
}
.script-input{
  width: 100%;
  min-height: 120px;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.16);
  padding: 12px;
  outline: none;
  resize: vertical;
  background: rgba(255,255,255,0.55);
  color: var(--text);
}

.script-view-wrap{
  padding: 10px 12px 0 12px;
  display:flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  flex: 1;
}
.script-hint{
  font-size: 12px;
  color: var(--muted);
}

.script-view{
  flex: 1;
  min-height: 0;
  overflow:auto;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.35);
  border: 1px solid rgba(255,255,255,0.18);
  line-height: 1.65;
  font-size: 14px;
}

/* word spans */
.word{
  cursor: pointer;
  padding: 0 2px;
  border-radius: 4px;
}
.word:hover{
  background: rgba(255,255,255,0.45);
}

.word.manual-last{
  background: rgba(255, 215, 0, 0.35);
  outline: 1px solid rgba(255, 215, 0, 0.35);
}
.word.auto-last{
  background: rgba(120, 220, 255, 0.25);
  outline: 1px solid rgba(120, 220, 255, 0.25);
}

.controls{
  display:flex;
  gap: 10px;
  padding: 12px;
  flex-wrap: wrap;
}
.btn{
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.12);
  background: rgba(255,255,255,0.85);
  cursor:pointer;
  font-weight: 600;
}
.btn.small{
  padding: 8px 10px;
  font-size: 12px;
}
.btn.primary{
  background: rgba(50, 110, 255, 0.9);
  border-color: rgba(50, 110, 255, 0.9);
  color: white;
}
.btn.danger{
  background: rgba(200, 60, 60, 0.92);
  border-color: rgba(200, 60, 60, 0.92);
  color: white;
}
.btn:disabled{
  opacity: 0.55;
  cursor: not-allowed;
}

.meters{
  padding: 0 12px 10px 12px;
}
.meter-row{
  display:flex;
  align-items:center;
  gap: 10px;
  margin: 8px 0;
}
.meter-label{
  width: 50px;
  font-size: 12px;
  color: var(--muted);
}
.meter-bar{
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.35);
  border: 1px solid rgba(255,255,255,0.18);
  overflow:hidden;
}
.meter-fill{
  height: 100%;
  width: 0%;
  background: rgba(0, 160, 90, 0.75);
}
.timer{
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.now-playing{
  padding: 10px 12px 12px 12px;
}
.now-playing h3{
  margin: 6px 0 8px 0;
  font-size: 14px;
}
.row{
  display:flex;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.hint{
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

.sep{
  border: none;
  height: 1px;
  background: rgba(255,255,255,0.18);
  margin: 0;
}

.takes{
  padding: 10px 12px 14px 12px;
  overflow:auto;
  min-height: 0;
}
.takes h3{
  margin: 0 0 10px 0;
  font-size: 14px;
}
.takes-list{
  list-style:none;
  padding:0;
  margin:0;
  display:flex;
  flex-direction: column;
  gap: 10px;
}
.take{
  padding: 10px;
  border-radius: 14px;
  background: rgba(255,255,255,0.35);
  border: 1px solid rgba(255,255,255,0.18);
}
.take-top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: 10px;
}
.take-title{
  font-weight: 800;
  font-size: 13px;
}
.take-meta{
  color: var(--muted);
  font-size: 12px;
}
.take-actions{
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.take textarea{
  width: 100%;
  margin-top: 10px;
  min-height: 54px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.12);
  padding: 10px;
  background: rgba(255,255,255,0.8);
  resize: vertical;
}

.footer{
  height: 42px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 0 16px;
  border-top: 1px solid rgba(0,0,0,0.08);
  color: var(--muted);
  font-size: 12px;
}
/* ================= TRACKS ================= */

#tracksPanel {
  margin-top: 2rem;
  padding: 1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
}

.track {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
}

.track button {
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
}

.track span {
  flex: 1;
  font-size: 0.9rem;
}
/* ================= TELEPROMPTER (STATIC) ================= */
/* ================= TELEPROMPTER (STATIC) ================= */

.teleprompter-wrap {
  margin-top: 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
}

.teleprompter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  font-size: 0.9rem;
  opacity: 0.9;
}

.teleprompter-header button {
  padding: 6px 10px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
}

.teleprompter-view {
  padding: 14px;
  max-height: 260px;
  overflow-y: auto;
  line-height: 2.1;
  font-size: 18px;
}

.teleprompter-view .tp-word {
  display: inline-block;
  padding: 2px 4px;
  margin-right: 2px;
  border-radius: 6px;
  cursor: pointer;
}

.teleprompter-view .tp-word.active {
  background: rgba(255, 220, 140, 0.35);
  outline: 1px solid rgba(255, 220, 140, 0.45);
}
/* ================= BOUNCING BALL ================= */

.tele-ball {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  box-shadow: 0 6px 14px rgba(0,0,0,0.25);
  pointer-events: none;
  transform: translate(-9999px, -9999px);
  transition: transform 120ms ease;
}

