:root{
  --bg:#0b0c10;
  --text:#e9ecf1;
  --muted:#a8b0bf;
  --stroke:#2a2f3a;

  --yellow:#f7d35a;
  --green:#57e389;
  --teal:#2dd4bf;
  --bad:#fb7185;

  --gap:#94a3b8;
  --slotText:#0b0c10;

  --shadow: 0 12px 30px rgba(0,0,0,.35);
  --radius: 16px;
}

body{
  margin:0;
  padding:24px;
  background: radial-gradient(1200px 800px at 20% 0%, #151a2d 0%, var(--bg) 55%);
  color:var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

h1{ margin:0 0 10px; font-size:20px; letter-spacing:.2px; }

.sub{
  margin:0 0 18px;
  color:var(--muted);
  font-size:13px;
  line-height:1.35;
  max-width:1100px;
}

.card{
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
  border:1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:14px;
}

.controlsCard{ margin-bottom:18px; }

.controls{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
  margin-top:12px;
}

button{
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.03);
  color:var(--text);
  border-radius: 12px;
  padding:10px 12px;
  font-size:13px;
  cursor:pointer;
}
button:hover{ filter: brightness(1.08); }

.mono{ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }

.leftHeader{ display:flex; justify-content:space-between; align-items:baseline; }
.leftTitle{ font-weight:950; font-size:14px; }
.leftMeta{ color:var(--muted); font-size:12px; }

.breakWrap{ margin-bottom:18px; }

.breakHeader{
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  margin-bottom:10px;
}
.breakHeader .title{ font-weight:950; font-size:14px; }
.breakHeader .meta{ color:var(--muted); font-size:12px; }

.breakBar{
  position:relative;
  width:100%;
  height:78px;
  border:1px dashed rgba(255,255,255,.12);
  border-radius: 14px;
  padding:10px;
  box-sizing:border-box;
  overflow:hidden;
  background: rgba(0,0,0,.18);
}

/* ✅ End-of-break unfilled time block (smaller text) */
.endGap{
  position:absolute;
  z-index:6;
  top:10px;
  bottom:10px;
  right:10px;

  display:flex;
  align-items:center;
  justify-content:center;

  border-radius:12px;
  background:#cbd5e1;
  color: rgba(0,0,0,.86);
  border:1px dashed rgba(0,0,0,.25);
  box-shadow: 0 10px 18px rgba(0,0,0,.28);

  font-weight:950;
  font-size:10px;            /* ✅ was 12px */
  letter-spacing: .2px;
  white-space:nowrap;
  padding:0 8px;             /* ✅ slightly smaller */
  overflow:hidden;

  transform-origin: right center;
  transform: scaleX(0);
  opacity: 0;
  pointer-events:none;
}

/* track */
.track{
  position:absolute;
  left:10px; right:10px;
  top:10px; bottom:10px;
  display:flex;
  gap:6px;
  align-items:stretch;
  justify-content:flex-start;
  z-index:2;
}

/* Slots are pixel-sized via inline flex-basis in JS; do NOT allow flex-grow */
.slot{
  position:relative;
  flex: 0 0 auto;
  min-width: 36px;

  border-radius: 12px;
  background: var(--yellow);
  color: var(--slotText);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:950;
  font-size:12px;
  box-shadow: 0 6px 14px rgba(0,0,0,.25);
  border:1px solid rgba(0,0,0,.18);
  overflow:hidden;
  transform: translateZ(0);
}

.slot .label{
  position:relative;
  z-index:2;
  opacity:.9;
  user-select:none;
}

/* slide-over cover */
.slot .cover{
  position:absolute;
  inset:0;
  display:flex;
  gap:4px;
  padding:6px;
  align-items:stretch;
  justify-content:flex-start;
  box-sizing:border-box;
  z-index:3;
  transform: translateY(-115%);
  opacity:0;
}

.slot.replaced .label{ opacity:.12; }
.slot.replaced .cover{
  transform: translateY(0);
  opacity:1;
  transition: transform 260ms cubic-bezier(.2,.8,.2,1), opacity 200ms ease;
}

.coverPiece{
  border-radius:10px;
  background: var(--teal);
  box-shadow: 0 8px 16px rgba(0,0,0,.35);
  border:1px solid rgba(0,0,0,.22);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:950;
  font-size:12px;
  color: rgba(0,0,0,.82);
  min-width: 26px;
}

.coverGap{
  border-radius:10px;
  background: var(--gap);
  box-shadow: 0 8px 16px rgba(0,0,0,.28);
  border:1px dashed rgba(0,0,0,.25);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:950;
  font-size:11px;
  color: rgba(0,0,0,.85);
  min-width: 26px;
}

.poolHeader{
  display:flex;
  justify-content:space-between;
  margin-bottom:10px;
}

.pool{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  padding:10px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.16);
}

.ad{
  width:86px;
  height:44px;
  border-radius:14px;
  background: var(--green);
  border:1px solid rgba(0,0,0,.2);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:950;
  color: rgba(0,0,0,.86);
  box-shadow: 0 10px 18px rgba(0,0,0,.30);
  user-select:none;
}
.ad.bad{ background: var(--bad); }
.ad.used{ opacity:.25; filter:saturate(.7); }

.floatClone{
  position:fixed;
  z-index:9999;
  border-radius:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:950;
  box-shadow: 0 18px 40px rgba(0,0,0,.45);
  border:1px solid rgba(255,255,255,.12);
  transform: translateZ(0);
  pointer-events:none;
  will-change: transform;
}

.highlight{
  outline: 3px solid rgba(87, 227, 137, .55);
  outline-offset: 2px;
  animation: pulse 800ms ease-in-out infinite;
}
.reject{
  outline: 3px solid rgba(251, 113, 133, .60);
  outline-offset: 2px;
  animation: shake 420ms ease-in-out 1;
}

@keyframes pulse{
  0%,100%{ outline-color: rgba(87,227,137,.25); }
  50%{ outline-color: rgba(87,227,137,.70); }
}
@keyframes shake{
  0%{ transform: translateX(0); }
  25%{ transform: translateX(-6px); }
  50%{ transform: translateX(6px); }
  75%{ transform: translateX(-4px); }
  100%{ transform: translateX(0); }
}

.log{
  margin-top:12px;
  padding:10px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.16);
  color:var(--muted);
  font-size:12px;
  min-height:60px;
}
.log b{ color: var(--text); }

@media (max-width:700px){
  .controls{ grid-template-columns:1fr; }
}
